Problem:
 Score : 100 points    Problem Statement A programming competition site AtCode regularly holds programming contests.  The next contest on AtCode is called ABC, which is rated for contestants with ratings less than 1200 .  The contest after the ABC is called ARC, which is rated for contestants with ratings less than 2800 .  The contest after the ARC is called AGC, which is rated for all contestants.  Takahashi's rating on AtCode is R . What is the next contest rated for him?      Constraints  0 ≤ R ≤ 4208  R is an integer.         Input Input is given from Standard Input in the following format:  R       Output Print the name of the next contest rated for Takahashi ( ABC , ARC or AGC ).        Sample Input 1 1199      Sample Output 1 ABC  1199 is less than 1200 , so ABC will be rated.       Sample Input 2 1200      Sample Output 2 ARC  1200 is not less than 1200 and ABC will be unrated, but it is less than 2800 and ARC will be rated.       Sample Input 3 4208      Sample Output 3 AGC

Solution (Python):



 
import sys
import math



 

fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile


mod=1000000007
 

def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 

n=int(input())
if(n<1200):
    print("ABC")
elif(n<2800):
    print("ARC")
else:
    print("AGC")
    
    

if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

Solution (Python):
R = int(input())
if R >= 2800:
    print("AGC")
elif R >= 1200:
    print("ARC")
else:
    print("ABC")

Solution (Python):

n = int(input())
if n < 1200:
  print("ABC") 
elif n < 2800: 
  print("ARC")
else: 
  print("AGC")

Solution (Python):
n = int(input())
if(n < 1200):
  print("ABC")
elif(n < 2800):
  print("ARC")
else:
  print("AGC")

Solution (Python):
R=int(input())
if R<1200:
  print("ABC")
elif R<2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
R = int(input())
if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r = int(input())
if r<1200:
	print('ABC')
elif r<2800:
	print('ARC')
else:
	print('AGC')

Solution (Python):
r = int(input())

if r < 1200:
  print("ABC")
elif r>= 1200 and r < 2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
rate = int(input())

if rate < 1200:
    print("ABC")
elif rate < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
r = int(input())
if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
R=int(input())
if R<1200:
    print("ABC")
elif R<2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
rate = int(input())

if rate < 1200:
    print("ABC")
elif rate < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R = int(input())

if 2800 <= R:
    print("AGC")
elif 1200 <= R and R < 2800:
    print("ARC")
else:
    print("ABC")

Solution (Python):
r = int(input())

if r<1200:
  print("ABC")
elif r<2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
R = int(input())
contests = ('ABC','ARC','AGC')

if(R < 1200):
    print(contests[0])
elif(R >= 1200 and R < 2800):
    print(contests[1])
else:
    print(contests[2])

Solution (Python):
R = int(input())
if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
N = list(map(int, input().split()))

if N[0] < 1200:
    print("ABC")
elif N[0] >= 1200 and N[0] < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):


a = raw_input()
r=int(a)
if r<=1199:
    print'ABC'
elif r<=2799:
    print'ARC'
else:
    print'AGC'

Solution (Python):
R = int(input())
if R < 1200:
    print('ABC')
elif 1200 <= R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r=int(input())

if r<1200:
    print("ABC")
elif r<2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R=int(input())

if R< 1200:
  print("ABC")
elif R<2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
r = int(input())

if r < 1200:
    print("ABC")
elif 1200 <= r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R = int(input())
if(R < 1200):
    print('ABC')
elif(R < 2800):
    print('ARC')
else:
    print('AGC')

Solution (Python):
r = int(input())
if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else :
    print("AGC")

Solution (Python):
def main():
  R = int(input())
  if R < 1200:
    print("ABC")
  elif R < 2800:
    print("ARC")
  else:
    print("AGC")

main()

Solution (Python):
def getNextRate(r):
  if(r < 1200):
    return 'ABC'
  elif(r < 2800):
    return 'ARC'
  else:
    return 'AGC'

if __name__ == '__main__':
  r = int(input())
  print(getNextRate(r))

Solution (Python):
R = int(input())
if R < 1200:
 print("ABC")
if R >= 1200 and R <2800:
 print("ARC")
if R >= 2800:
 print("AGC")

Solution (Python):
R = int(input())

if R >= 2800:
    print("AGC")
elif R >= 1200:
    print("ARC")
else:
    print("ABC")

Solution (Python):
rate = int(input(''))

ans = 'AGC'

if  rate < 2800:
    ans =  'ARC '

if  rate < 1200:
    ans = 'ABC'

print(ans)

Solution (Python):
R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
a = input()
a = int(a)
if a < 1200:
  print("ABC")
elif 1200 <= a and a < 2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
r = int(input())

if r < 1200:
    print('ABC')
elif 1200 <= r < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r = int(input())
if r <1200:
    print('ABC')
elif r< 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r=int(input())
if r < 1200:
  print('ABC')
elif 1200 <= r < 2800:
  print('ARC')
else:
  print('AGC')

Solution (Python):
x = int(input())
if x<1200:
	print('ABC')
elif x<2800:
	print('ARC')
else:
	print('AGC')

Solution (Python):

A = int(input())

if(A<1200):
    print("ABC");
elif(A<2800):
    print("ARC");
else:
    print("AGC");

Solution (Python):
R = int(input())

if R < 1200:
  print('ABC')
elif R < 2800:
  print('ARC')
else:
  print('AGC')

Solution (Python):
R = int(input())

if R < 1200:
  print('ABC')
elif R < 2800:
  print('ARC')
else:
  print('AGC')

Solution (Python):
R = int(input())

if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
elif R <= 4208:
    print("AGC")
else:
    print("")

Solution (Python):
x = int(input())
print('ABC' if x < 1200 else "ARC" if x < 2800 else 'AGC')

Solution (Python):
R = int(input())

if R < 1200:
  print('ABC')
elif R < 2800:
  print('ARC')
else:
  print('AGC')

Solution (Python):
R = int(input())

if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
N = int(input())

if N < 1200:
    print("ABC")
if N >= 1200 and N < 2800:
    print("ARC")
if N >= 2800:
    print("AGC")

Solution (Python):
rate=int(input())
result=""
if rate<1200:
  result="ABC"
elif rate<2800:
  result="ARC"
else:
  result="AGC"
print(result)

Solution (Python):
def main():
    R = int(raw_input())

    if R < 1200:
        print 'ABC'
    elif R < 2800:
        print 'ARC'
    else:
        print 'AGC'

main()

Solution (Python):
r = int(input())
if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
r=int(input())
if r<1200:
  print('ABC')
elif 1200<=r and r<2800:
  print('ARC')
else:
  print('AGC')

Solution (Python):
a = int(input())
if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):

 
a=int(input())

if a<1200 :
    print('ABC')
elif a<2800 :
    print('ARC')
else :
    print('AGC')

Solution (Python):
def A():
    r = int(input())
    contest = ['ABC','ARC','AGC']
    index = 0
    if r < 1200:
        index = 0
    elif r >= 1200 and r < 2800:
        index = 1
    else:
        index = 2
    print(contest[index])
    

if __name__ =='__main__':
    A()

Solution (Python):
r = int(input())

if(r < 1200):
    print ("ABC")
elif(r < 2800):
    print ("ARC")
else:
    print ("AGC")

Solution (Python):
R=int(input())
if R<1200:
    print("ABC")
elif R<2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
N = int(input())

if N < 1200:
    print("ABC")
elif N < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
s = int(input())

if s < 1200:
    print("ABC")
elif s < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
r = int(input())
if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
r = int(input())

if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
r = int(input())
if r<1200:
  print("ABC")
elif r<2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
r = int(input())
if(r<1200):print('ABC')
elif(r<2800):print('ARC')
else:print('AGC')

Solution (Python):
a=input()
b=int(a)
if b<1200:
    print("ABC")
elif b>=1200 and b<2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
import sys
n = int(input())

if(n < 1200):
    print('ABC')
elif(n >= 1200 and n <= 2799):
    print('ARC')
else:
    print('AGC')

Solution (Python):
val = int(input())
ans = ""
if val < 1200 and val >= 0:
    ans = ans + ("ABC")
if val < 2800 and val >= 1200:
    ans = ans + ("ARC")
if ans == "":
    ans  = ans + "AGC"
    
print(ans)

Solution (Python):
r = int(input())

if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
R=int(input())
if R<1200:
  print("ABC")
elif R>=1200 and R<2800:
  print("ARC")
elif R>=2800:
  print("AGC")

Solution (Python):
from sys import stdin                                                                                                                                                                                       
r = int(stdin.readline().rstrip())                                                                                                                                                                          
                                                                                                                                                                                                            
if r < 1200:                                                                                                                                                                                                
    print("ABC")                                                                                                                                                                                            
elif r <2800:                                                                                                                                                                                               
    print("ARC")                                                                                                                                                                                            
else:                                                                                                                                                                                                       
    print("AGC")

Solution (Python):
s = int(input())
if s < 1200 : print("ABC")
elif s < 2800 : print("ARC")
else : print("AGC")

Solution (Python):
R = int(input())
if R < 1200 :
    print("ABC")    
elif R < 2800 :
    print("ARC")    
else:
    print("AGC")

Solution (Python):
R = int(input())

if (R < 1200):
    print('ABC')
elif (R < 2800):
    print('ARC')
else:
    print('AGC')

Solution (Python):
import sys
s = int(input())
if s < 1200:
    print("ABC")
    sys.exit()
if s < 2800:
    print("ARC")
    sys.exit()
else:
    print("AGC")

Solution (Python):
rating = int(input())
if rating >= 0 and rating < 1200:
    print('ABC')
elif rating >= 1200 and rating < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
n=int(input())
if n<1200:
    print("ABC")
elif n<2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
r=int(input())
if r>=2800:
	print('AGC')
elif r>=1200:
	print('ARC')
else:
	print('ABC')

Solution (Python):
r = int(input())
if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
r = int(input())

if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):


R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
R = int(input())
if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
r=int(input())
if r <1200:
    print("ABC")
elif r<2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
r = int(input())
if r<1200:
    print("ABC")
elif r<2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R = int(input())
if R < 1200:
	print("ABC")
elif R < 2800:
	print("ARC")
else:
	print("AGC")

Solution (Python):
r = int(input())

if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
def main():
    num = int(input())
    if num < 1200:
        print("ABC")
    elif num < 2800:
        print("ARC")
    else:
        print("AGC")

if __name__ == "__main__":
    main()

Solution (Python):
r = int(input())
if r < 1200:
    print("ABC")
elif 1200 <= r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
a = int(input())

if (a<1200) :
   print("ABC")

elif (a<2800):
   print("ARC")

else :
   print("AGC")

Solution (Python):
r = int(input())

if r < 1200:
    print("ABC")

elif 1200 <= r and r < 2800:
    print("ARC")

elif 2800 <= r:
    print("AGC")

Solution (Python):
a = int(input())

if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R=int(input())
if R<1200:
    print('ABC')
elif R<2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
R=int(input())
if R<1200:
  print("ABC")
elif R<2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
r = int(input())
if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
k=int(input())
if k<1200:
    print('ABC')
elif 1200<=k<2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('a1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    r = read_int()
    if r < 1200:
        print('ABC')
    elif r >= 2800:
        print('AGC')
    else:
        print('ARC')


main()

Solution (Python):
r = int(input())

if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
from sys import stdin

R = int(stdin.readline().rstrip())

if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
a = int(input())

if a < 1200: print('ABC')
if 1200 <= a < 2800: print('ARC')
if 2800 <= a <= 4208: print('AGC')

Solution (Python):
r = int(input())

if r < 1200:
  print('ABC')

elif 1200 <= r < 2800:
  print('ARC')

else:
  print('AGC')

Solution (Python):
r = int(raw_input())
if r < 1200:
  print "ABC"
elif r < 2800:
  print "ARC"
else:
  print "AGC"

Solution (Python):
R = int(input())

if R < 1200:
    print('ABC')
elif  1200 <= R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r = int(input())
if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
r = int(input())

if r<1200:
    print('ABC')
elif 1200<=r <2800:
    print('ARC')
elif r >= 2800:
    print('AGC')

Solution (Python):
R = int(input())
if R<1200:
	print("ABC")
elif R<2800:
	print("ARC")
else:
	print("AGC")

Solution (Python):
r = int(input())

if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
R = int(raw_input())
if R < 1200:
    print "ABC"
elif R < 2800:
    print "ARC"
else:
    print "AGC"

Solution (Python):
R = int(input())
if R < 1200:
  print('ABC')
elif R < 2800:
  print('ARC')
else:
  print('AGC')

Solution (Python):
r = int(input())
if r <1200:
  print("ABC")
elif r >= 1200 and r <2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):

"""
Created on Sun Aug  5 19:15:42 2018
ABC104A
@author: maezawa
"""

r = int(input())
if r >= 2800:
    print('AGC')
elif r >= 1200:
    print('ARC')
else:
    print('ABC')

Solution (Python):
r = int(input())

if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r = int(input())
if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R = int(input())

if R <1200:
    print('ABC')
elif 1200<=R <2800:
    print('ARC')
elif R>=2800:
    print('AGC')

Solution (Python):
score = int(input())
if score < 1200:
    print('ABC')
elif score <2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
n = int(input())
if n <1200:
    print("ABC")
elif n <2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
r = int(input())
if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):



def main():
    N = int(input())
    if N < 1200:
        print("ABC")
    elif N < 2800:
        print("ARC")
    else:
        print("AGC")


if __name__ == '__main__':
    main()

Solution (Python):
R = int(input())

if R <= 1199:
    print("ABC")
elif R <=2799:
    print("ARC")
else:
    print("AGC")

Solution (Python):
r = int(input())

if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r = int(input())

if r < 1200:
  print('ABC')
elif r < 2800:
  print('ARC')
else:
  print('AGC')

Solution (Python):
R=int(input())
if R<1200:
    print('ABC')
else:
    if R<2800:
        print('ARC')
    else:
        print('AGC')

Solution (Python):
R = int(input())

if R<1200 :
    print("ABC")
elif R<2800 :
    print("ARC")
else:
    print("AGC")

Solution (Python):
r = int(raw_input())

if r < 1200:
    print "ABC"
elif r < 2800:
    print "ARC"
else:
    print "AGC"

Solution (Python):
inp = input()
rate = int(inp)

if rate < 1200:
    print("ABC")
elif rate < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R=int(input())
if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
N = int(input())
if N < 1200:
    print('ABC')
elif N < 2800 and N >= 1200:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r = input()
R = int(r)

if R < 1200:
    print('ABC')
elif R >= 1200 and R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r = int(input())

if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):


def main():
    r = int(input())
    if r < 1200:
        print('ABC')
    elif r >= 1200 and r < 2800:
        print('ARC')
    else:
        print('AGC')

if __name__ == '__main__':
    main()

Solution (Python):
R = int(input())
if R < 1200:
  print("ABC")
elif R <2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
R = int(input())

if R < 1200:
  print('ABC')
elif R < 2800:
  print('ARC')
else:
  print('AGC')

Solution (Python):
R = int(input())
if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
R = int(input())

if(R < 1200):
  print("ABC")

elif(R < 2800):
  print("ARC")

else:
  print("AGC")

Solution (Python):
r = int(input())
if r<1200:
  print("ABC")
elif r<2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
R = int(input())

if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):

r = int(input())
if(r < 1200):
  print("ABC")
elif(r < 2800):
  print("ARC")
else:
  print("AGC")

Solution (Python):
r=int(input())

if r<1200:
  print("ABC")
elif r<2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
r = int(input())

print("ABC" if r < 1200 else "ARC" if r < 2800 else "AGC")

Solution (Python):

R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
i = int(input())

if i < 1200:
    print("ABC")

elif i < 2800:
    print("ARC")

else:
    print("AGC")

Solution (Python):
x = int(input())
if 1200 > x:
    print("ABC")
elif 1200<= x < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R = int(input())
if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r = int(input())
if r < 1200:
    print('ABC')
elif 1200 <= r < 2800:
    print('ARC')
elif 2800 <= r:
    print('AGC')

Solution (Python):
R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
R = int(input())
if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r = int(input())
if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R = int(input())
if R < 1200:
  print("ABC")
elif R < 2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
r = int(input())

if r < 1200:
  print("ABC")
elif 1200 <= r < 2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
r=int(input())
if r<1200:
  print("ABC")
elif r<2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):


r = int(input())

if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):


R = int(input())

if R < 1200:
    print("ABC")
elif 1200 <= R < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
inputs = input()
R = int(inputs)

if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
num = int(input())
if num < 1200:
    print("ABC")
elif 2800 > num >= 1200:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R = int(input())
if R < 1200:
	print('ABC')
elif R < 2800:
	print('ARC')
else:
	print('AGC')

Solution (Python):
r = int(input())

if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
R=input()
if R<1200:
	print "ABC"
elif 1200<=R<2800:
	print "ARC"
else:
	print "AGC"

Solution (Python):
r = int(input())
if r >= 2800:
    print("AGC")
elif r < 2800 and r >= 1200:
    print("ARC")
else:
    print("ABC")

Solution (Python):
R = int(input())						

ans='AGC'

if R<2800: ans='ARC'
if R<1200: ans='ABC'

print(ans)

Solution (Python):
def main():
    r = int(input().strip())

    if r < 1200:
        print('ABC')
    elif r < 2800:
        print('ARC')
    else:
        print('AGC')

        
if __name__ == '__main__':
    main()

Solution (Python):
R = int(input())

if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R = int(input())
if 1200 > R:
    print("ABC")
elif 2800 > R:
    print("ARC")
else:
    print("AGC")

Solution (Python):
from sys import stdin


def main():
    R = int(stdin.readline().rstrip())
    if R < 1200:
        print('ABC')
    elif 1200 <= R < 2800:
        print('ARC')
    else:
        print('AGC')


if __name__ == '__main__':
    main()

Solution (Python):
R = int(input())
if R >= 2800:
    print("AGC")
elif R >= 1200:
    print("ARC")
else:
    print("ABC")

Solution (Python):
r = int(input())
 
if (r<1200):
  print("ABC")
elif (r<2800):
  print("ARC")
else:
  print("AGC")

Solution (Python):
rate = int(input())
if rate < 1200:
  print('ABC')
elif rate < 2800:
  print('ARC')
else:
  print('AGC')

Solution (Python):
R=int(input())
if R < 1200:
  print('ABC')
elif R < 2800:
  print('ARC')
else:
  print('AGC')

Solution (Python):
r=int(input())
if r<1200: print('ABC')
elif r<2800: print('ARC')
else: print('AGC')

Solution (Python):
r = int(input())
if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
n = int(input())

if n < 1200:
    print("ABC")
elif n < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
n = int(input())

if n < 1200:
    print("ABC")
elif n < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R = int(input())

if R<1200:
  print('ABC')
elif R<2800:
  print('ARC')
else:
  print('AGC')

Solution (Python):
n=int(input())
if n<1200:
    print("ABC")
elif n<2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R = int(input())

if R < 1200:
  print("ABC")
elif R < 2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
R = int(input())
if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
R = int(input())

if R < 1200:
    C = 'ABC'
elif R < 2800:
    C = 'ARC'
else:
    C = 'AGC'
print(C)

Solution (Python):
a = int(input())
if a < 1200:
    print('ABC')
elif a < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
a=int(input())
if a<1200:
    print('ABC')
elif 1200<=a<2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
n=int(input())
if n<1200:
    print("ABC")
elif n<2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
from sys import stdin, stdout

input = lambda: stdin.readline().rstrip()
write = stdout.write

def main():
    R = int(input())

    if R < 1200:
        write('ABC\n')
    elif R < 2800:
        write('ARC\n')
    else:
        write('AGC\n')

main()

Solution (Python):
R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r = int(input())

if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
a = int(input())

if a < 1200:
    ans = 'ABC'
elif a < 2800:
    ans = 'ARC'
else:
    ans = 'AGC'

print(ans)

Solution (Python):
R = int(input())
if R<1200:
        print("ABC")
elif R<2800:
        print("ARC")
else:
        print("AGC")

Solution (Python):
n=int(input())
if n<1200:
  print("ABC")
elif n<2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
r = int(input())
if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r = int(input())

if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
n = int(input())
if n < 1200:
    print("ABC")
elif n < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
r=int(input())
print("AGC" if r>=2800 else "ARC" if r>=1200 else "ABC")

Solution (Python):
r = int(input())
if r<1200:
    print('ABC')
elif r<2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):

r = int(raw_input())

if 2800 <= r:
    print("AGC")
elif r < 1200:
    print("ABC")
elif 1200 <= r < 2800:
    print("ARC")

Solution (Python):
R = int(input())

if R < 1200:
	print("ABC")
elif R < 2800:
	print("ARC")
else:
	print("AGC")

Solution (Python):
def main():
    R = int(input())

    if R < 1200:
        print("ABC")
    elif R < 2800:
        print("ARC")
    else:
        print("AGC")


if __name__ == '__main__':
    main()

Solution (Python):
R = int(input())
if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
R = int(input())
if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
a = int(input())
if a<1200:
  print("ABC")
elif a < 2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):

R = int(input())

if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r = int(input())

if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
n=int(input())

if n<1200:
  print("ABC")
elif n<2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
a = int(input())
print("ABC" if a < 1200 else "ARC" if a < 2800 else "AGC")

Solution (Python):
n=int(input())
if n<1200:
    print('ABC')
elif n<2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r = int(input())

if r < 1200:
  print("ABC")
elif r < 2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
r=i1()
if r<1200:
 print("ABC")
elif r<2800:
 print("ARC")
else:
 print("AGC")

Solution (Python):
r = int(input())

if(r < 1200): print("ABC")
elif(r < 2800): print("ARC")
else: print("AGC")

Solution (Python):
R=int(input())
if R<1200 :
  print("ABC")
elif R<2800 :
  print("ARC")
else:
  print("AGC")

Solution (Python):
n=int(input())
if n<1200:
    print('ABC')
elif n<2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r = int(input())
if r <1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R = int(input())

if R < 1200:
  print("ABC")
elif R < 2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
r = int(input())

if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
R = int(input())
if R < 1200:
	print('ABC')
elif 1200 <= R < 2800:
	print('ARC')
else:
	print('AGC')

Solution (Python):
r = int(input())

if r < 1200:
	print('ABC')
elif r < 2800:
	print('ARC')
else:
	print('AGC')

Solution (Python):
r = int(input())
if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R = input()

if R < 1200:
	print ("ABC")
elif R < 2800:
	print ("ARC")
else:
	print ("AGC")

Solution (Python):
R = int(input())

if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
r=int(input())
if r<1200:
  print('ABC')
elif r<2800:
  print('ARC')
else:
  print('AGC')

Solution (Python):
a = int(input())
if(a < 1200):
    print("ABC")
elif(a < 2800):
    print("ARC")
else:
    print("AGC")

Solution (Python):
a = int(input())

if a < 1200:
    print('ABC')
elif a < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
def main(R):
    if R < 1200:
        print("ABC")
    elif R < 2800:
        print("ARC")
    else:
        print("AGC")

if __name__ == '__main__':
    R = int(input())
    main(R)

Solution (Python):
R = int(input())

ans = 'AGC'

if R < 1200:
    ans = 'ABC'
elif R < 2800:
    ans = 'ARC'

print(ans)

Solution (Python):
R = int(input())
if R < 1200:
    print('ABC')
elif 1200 <= R < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
l = int(input())
if l<1200:
    print("ABC")
elif l<2800:
    print("ARC")
else :
    print("AGC")

Solution (Python):
r = int(input())

if r < 1200:
  print("ABC")
elif r < 2800:
  print("ARC")
else:
  print("AGC")

Solution (Python):
R = int(input())

if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")