{
Written by Fyodor Menshikov 16.02.2005
}
   procedure ac;
   begin
      writeln('a');
      halt;
   end;

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

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

var
   userA,judgeA:string;
begin
   assign(input,ParamStr(2));
   reset(input);
   readln(userA);
   if not eof then
      pe;
   if length(userA)>20 then
      pe;
   assign(input,ParamStr(3));
   reset(input);
   readln(judgeA);
   if userA=judgeA then
      ac
   else
      wa;
end.
