#include <iostream>
#include <fstream>

using namespace std;

[[noreturn]] void err(const char *msg) {
    cerr << msg;
    exit(1);
}

[[noreturn]] void grade(float score, const char* msg) {
    cout << score;
    cerr << msg;
    exit(0);
}

int main(int argc, char* argv[]){
    ifstream input(argv[1]);
    ifstream master_output(argv[2]);
    ifstream contestant_output(argv[3]);

    if(!input.is_open())
        err("Cannot open input file!");
    if(!contestant_output.is_open())
        err("Cannot open output file!");
    if(!master_output.is_open())
        err("Cannot open correct output file!");

    string sol, cont;
    while (master_output >> sol) {
        if (!(contestant_output >> cont)) grade(0, "translate:wrong");
        if (sol != cont) grade(0, "translate:wrong");
    }
    if (contestant_output >> cont) grade(0, "translate:wrong");
    grade(1, "translate:success");
}
