{
Written by Fyodor Menshikov 12.02.2004
}
{$N+,E-}

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

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

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

var
   c:char;

   procedure nextchar;
   begin
      if eoln then
         c:=#13
      else
         read(c);
   end;

type
   real=extended;
var
   judgeanswer:real;
   useranswer:real;
   i:integer;
begin
   assign(input,'check.txt');
   reset(input);
   readln(judgeanswer);
   assign(input,'output.txt');
   reset(input);
   nextchar;
   if c in ['0','1'] then
      nextchar
   else
      pe;
   if c<>'.' then
      pe;
   nextchar;
   for i:=1 to 5 do
      if c in ['0'..'9'] then
         nextchar
      else
         pe;
   if c<>#13 then
      pe;
   readln;
   if not eof then
      pe;
   reset(input);
   readln(useranswer);
   if useranswer>1 then
      pe;
   if abs(judgeanswer-useranswer)>1.1e-5 then
      wa;
   ac;
end.