uses
  testlib, sysutils;


const
	MAXN = 100;

type
	arr = array[1..MAXN] of string;

procedure sort(var a : arr; n : longint);
var
	i, j : longint;
	tmp : string;
begin
	for i := 1 to n do begin
		for j := i + 1 to n do begin
			if (a[i] > a[j]) then begin
		        	tmp := a[i];
				a[i] := a[j];
				a[j] := tmp;
			end;
		end;
	end;
end;

var
  ja, pa: arr;
  i: longint;
  l: longint;

begin 
  l := 0;
  while not ouf.eof and not ans.eof do begin
    inc(l);
    pa[l] := ouf.readstring;
    ja[l] := ans.readstring;
  end;
  if ouf.seekEof and not ans.seekEof then begin
    QUIT (_WA, 'Not enough lines! "' + ans.readString + '" expected' );
  end;
  if ans.seekEof and not ouf.seekEof then begin
    QUIT (_WA, 'Extra lines! "' + ouf.readString + '" encountered' );
  end;
  sort(pa, l);
  sort(ja, l);
  for i := 1 to l do begin
	if (ja[i] <> pa[i]) then begin
		QUIT(_WA, 'Answers differ: expected ' + ja[i] + ', but found ' + pa[i]);
	end;
  end;

  QUIT ( _OK, 'Ok' );
end.