{ VERIFICATION PROGRAM for "Amusing Numbers" problem for NEERC'2002 }
{ (C) Roman Elizarov, 2002 }
{$APPTYPE CONSOLE}
program AMUSING_CHECK;
uses
  sysutils, testlib in '..\testlib.pas';

function GetNum(var ins: InStream): string;
var
  i: integer;
begin
  result := ins.ReadString;
  for i := 1 to length(result) do
    if (result[i] < '0') or (result[i] > '9') then
      ins.quit(_PE, 'Not a number in file');
end;

var
  souf, sans: string;

begin
  try
    sans := GetNum(ans);
    souf := GetNum(ouf);
    if not ouf.seekeof then
      Quit(_PE, 'Extra data in file');
    if souf <> sans then
      Quit(_WA, 'Wrong answer: ' + souf + ' <> ' + sans);
    Quit(_OK, 'Ok');
  except on e: Exception do
    Quit(_FAIL, e.Message);
  end;
end.
