{ NEERC'98 Problem "Parliament"
  Checking program by Roman Elizarov
  19.11.98
}
{$A+,B-,D+,E+,F-,G+,I+,L+,N+,O-,P-,Q+,R+,S+,T-,V+,X+,Y+}
program PARLIAM_CHECK;
uses
  testlib;

const
  max_cnt = 5000;

type
  result = record
             c: integer;
             a: array[1..max_cnt] of longint;
           end;

procedure ReadRes ( var s: InStream; var r: result );
var
  many: boolean;
  this: longint;
begin
  r.c:= 0;
  many:= false;
  while not s.seekeof do begin
    this:= s.readlongint;
    if s.seekeoln and not s.seekeof then
      s.QUIT ( _PE, 'More than one line the file' );
    if r.c >= max_cnt then
      many:= true
    else begin
      inc ( r.c );
      r.a[r.c]:= this;
    end;
  end;
  if many then
    s.QUIT ( _WA, 'Too many numbers in file' );
end;

var
  r_ans, r_ouf: result;
  i: integer;

begin
  readRes ( ans, r_ans );
  readRes ( ouf, r_ouf );
  if r_ouf.c <> r_ans.c then
    QUIT ( _WA, 'Wrong count ');
  for i:= 1 to r_ans.c do
    if r_ouf.a[i] <> r_ans.a[i] then
      QUIT ( _WA, 'Wrong number');
  QUIT ( _OK, 'Ok' );
end.
