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

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

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

var
   n:integer;
   m,l:longint;
   c:char;
   a:array[1..1000]of char;
   alen,i:integer;
begin
   assign(input,'input.txt');
   reset(input);
   readln(n,m,l);
   assign(input,'output.txt');
   reset(input);
   alen:=0;
   while not eoln do begin
      read(c);
      if not (c in ['a','b']) then
         pe;
      inc(alen);
      if alen>l then
         pe;
      a[alen]:=c;
   end;
   readln;
   if not eof then
      pe;
   assign(input,'check.txt');
   reset(input);
   for i:=1 to alen do begin
      if eoln then
         wa;
      read(c);
      if c<>a[i] then
         wa;
   end;
   if not eoln then
      wa;
   ac;
end.
