#include <iostream>
#include <cstdio>
#include <cstdlib>

using namespace std;

const int MIN_VAL=1, MAX_VAL=1000000000;

void PE(const char *s){
  cout << "PE: " << s << endl;
  exit(2);
}

void WA(const char *s){
  cout << "WA: " <<s << endl;
  exit(1);
}

void AC(){
  cout << "OK" << endl;
  exit(0);
}

int main (int, char *argv[]) {
  FILE *fout, *fans;
  fout = fopen(argv[2],"r");
  fans = fopen(argv[3],"r");
  int v_ans;
  while (fscanf(fans,"%d", &v_ans)!=EOF) {
    int v_out;
    int res = fscanf(fout,"%d",&v_out);
    if (res == EOF) PE ("It is not enough data in output file");
    if (res == 0) PE ("Not a number in output file");
    if (v_out<MIN_VAL || v_out>MAX_VAL) PE("Number in wrong range");
    if (v_out!=v_ans) WA("Answers are not equal");
  }

  if (fscanf(fout,"%*d")!=EOF)
    PE("Excess data in output file");

  fclose(fout);
  fclose(fans);

  AC();
}
