var
  inFile, outFile, ansFile : Text;
  i, n, a, b : Integer;
  ok : Boolean;
  r : Real;

begin
  Assign(inFile, ParamStr(1));
  Reset(inFile);
  Readln(inFile, n);
  Close(inFile);

  Assign(outFile, ParamStr(2));
  Assign(ansFile, ParamStr(3));
  Reset(outFile);
  Reset(ansFile);

  ok := true;
  i := 0;
  while ok and (i < n) and (not EOF(outFile)) do
  begin
    Readln(outFile, a);
    Readln(ansFile, b);
    ok := a = b;
    inc(i);
  end;

  Close(outFile);
  Close(ansFile);

  if (i < n) then ok := false;

  if ok then
    Writeln(10)
  else
    Writeln(0);
end.
