//
// Written by Fyodor Menshikov 07.03.2010
//

	procedure ac;
	begin
		writeln('a');
		halt(0);
	end;

	procedure wa;
	begin
		writeln('wa');
		halt(1);
	end;

	procedure pe;
	begin
		writeln('pe');
		halt(2);
	end;

	procedure ie;
	begin
		writeln('ie');
		while true do;
	end;

var
	uf, jf : text;
	us, js : string;
begin
	assign(jf, 'missing.chk');
	reset(jf);
	readln(jf, js);
	if not eof(jf) then begin
		ie;
	end;
	close(jf);
	if 
		(length(js) <> 5) or 
		not (js[1] in ['0'..'9']) or 
		not (js[2] in ['0'..'9']) or
		(js[3] <> ' ') or
		not (js[4] in ['0'..'9']) or
		not (js[5] in ['0'..'9'])
	then begin
		ie;
	end;

	assign(uf, 'missing.out');
	reset(uf);
	readln(uf, us);
	if not eof(uf) then begin
		pe;
	end;
	close(uf);
	if 
		(length(us) <> 5) or 
		not (us[1] in ['0'..'9']) or 
		not (us[2] in ['0'..'9']) or
		(us[3] <> ' ') or
		not (us[4] in ['0'..'9']) or
		not (us[5] in ['0'..'9'])
	then begin
		pe;
	end;
	if us <> js then begin
		wa;
	end;
	ac;
end.