program ii;
var s,s1:string[11];
    c,code:longint;

BEGIN
repeat
readln(s);
s1:=COPY(s,1,6)+COPY(s,8,4);
s1[0]:=chr(10);
val(s1,c,code);
if ((c mod 11)<>0) then writeln('invalid')
else if ((s[3]='5')OR(s[3]='6')) then writeln('girl')
else if ((s[3]='0')OR(s[3]='1')) then writeln('boy')
else if s='end' then halt
else writeln('invalid');
until s='end';
end.
