File size: 826 Bytes
c4b0eef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
****************************************************************
****************************************************************
-> Coded by Stavros Chryselis				   
-> Visit my github for more solved problems over multiple sites 
-> https://github.com/StavrosChryselis			  
-> Feel free to email me at [email protected]	
****************************************************************
****************************************************************
*/

#include<stdio.h>

int main()
{ 
  int l,m,n;
  
  scanf("%d",&l);
  scanf("%d",&m);
  scanf("%d",&n);
  
  while(1)
  {
    if(m==0&&n==0&&l==0)
     break;
     
    else if((2*m)==(n+l)) 
      printf("AP  %d\n",(n+(m-l)));
   
    else
      printf("GP  %d\n",(n*(m/l)));
      
    scanf("%d",&l);
    scanf("%d",&m);
    scanf("%d",&n);
  } 
  return 0;
}