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

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

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


var
  fans, fout: Text;
  sout, sans: String;

begin
  assign(fout, ParamStr(2)); reset(fout);
  assign(fans, ParamStr(3)); reset(fans);
  readln(fout,sout);
  if (sout<>'YES') and (sout<>'NO') then pe;
  readln(fans,sans);
  if sout<>sans then wa else ac;
end.
