/APGP - Cấp số cộng - Cấp số nhân

<Problem>

http://ntucoder.net/Problem/Details/1199
              Uses Crt;
        Var     a,b,c:longint;
        Begin
                repeat
                   readln(a,b,c);
                   if (a=0) and (b=0) and (c=0) then exit;
                   if (b-a=c-b) then writeln('AP',' ',c+b-a) else
                   if (b div a=c div b) then writeln('GP',' ',c*(c div b))
                until (a=0) and (b=0) and (c=0);
        End.