import ru.ifmo.testlib.Checker;
import ru.ifmo.testlib.InStream;
import ru.ifmo.testlib.Outcome;
import static ru.ifmo.testlib.Outcome.Type.*;

public class Check implements Checker {
	public static Outcome outcome(Outcome.Type type, String format, Object... args) {
		return new Outcome(type, String.format(format, args));
	}
	
	@Override
	public Outcome test(InStream inf, InStream ouf, InStream ans) {
		inf.nextInt();
		int m = inf.nextInt();
		for (int i = 0; i < m; i++) {
			int ja = ans.nextInt();
			int pa = ouf.nextInt();
			if (ja != pa) {
				return outcome(WA, "Expected %d, found %d in position %d", ja, pa, i + 1);
			}
		}
		return outcome(OK, "%d queries", m);
	}
}
