//http://www.spoj.com/problems/ACPC10A/
//mayur shingote :)
#include<stdio.h>
int main()
{
int a1,a2,a3;
while(1)
{
scanf("%d%d%d",&a1,&a2,&a3);
if(a1==0&&a2==0&&a3==0)
break;
if((a3-a2)==(a2-a1))
{
printf("AP %d\n",a3+(a3-a2));
}
else
{
printf("GP %d\n",a3*(a3/a2));
}
}
return 0;
}
No comments:
Post a Comment