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):
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())


ans = str()
if R < 1200:
    ans = "ABC"
elif R < 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):
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):
n = int(input())

if n < 1200:
    print('ABC')
if n >= 1200 and n < 2800:
    print('ARC')
if n >= 2800:
    print('AGC')

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

Solution (Python):
def main():
    n = int(input())
    if n < 1200:
        print("ABC")
    elif 1200 <= n < 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 < 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):
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):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    R = I()

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

if __name__ == '__main__':
    resolve()

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

Solution (Python):
a=int(input())
print(["ABC","ARC","AGC"][(a>=1200)+(a>=2800)])

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 1200 <= a < 2800:
    print("ARC")
elif 2800 <= a:
    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 >= 1200 and 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())
print("A"+"RGB"[(R>=2800)+2*(R<1200)]+"C")

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

ans = ""
if R < 1200:
    ans = "ABC"
elif 1200 <= R < 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):
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):
rating = int(input())

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

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

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():
    r = int(input())
    if r >= 2800:
        print("AGC")
    elif r >= 1200:
        print("ARC")
    else:
        print("ABC")


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):
import sys
input = sys.stdin.buffer.readline




def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return float(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))




def main():
	r=II()
	ans="AGC"
	if r<1200:
		ans="ABC"
	elif r<2800:
		ans="ARC"
	print(ans)





if __name__ == "__main__":
	main()

Solution (Python):
a=input()
if int(a)<=1199:
  print("ABC")
elif int(a)<=2799:
  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):



from fractions import gcd
from itertools import combinations,permutations,accumulate, product 

from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect














import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7


from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
  return int(readline())
r = I()
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:
    ans = "ABC"
elif R < 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):
r = int(input())
if r < 1200: ans = "ABC"
elif r < 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):
R = int(input())
if R<1200:
    print("ABC")
elif R<2800:
    print("ARC")
else:
    print("AGC")

Solution (Python):
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right
from math import gcd,ceil,floor,factorial

from functools import reduce
from pprint import pprint
from statistics import mean,median,mode

INF = float("inf")

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

def I():
    return int(input())

def MI():
    return map(int,input().split())

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

def CI(n):
    return [ int(input()) for _ in range(n) ]

def LI(n):
    return [ list(map(int,input().split())) for _ in range(n) ]

def S():
    return input()

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

def RS():
    return list(input())

def CS(n):
    return [ input() for _ in range(n) ]

def LS(n):
    return [ list(input()) for _ in range(n) ]







r = I()

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 <= 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 1200 <= R and R < 2800:
  print('ARC')
else:
  print('AGC')

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

while(num1 >= 0):
  if num1 < 1200:
    print(f"ABC")
  elif num1 >= 1200 and num1 < 2800:
    print(f"ARC")
  elif num1 >= 2800 and num1 <= 4208:
    print(f"AGC")
  break

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

Solution (Python):
rating = int(input())
if(rating>=0 and rating<1200):
  print("ABC")
elif(rating < 2800):
  print("ARC")
elif(rating <= 4208):
  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>=1200 and 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:
  ans="ABC"
elif 1200<=r<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):
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>=2800:
  print("AGC")
if 1200<=a<2800:
  print("ARC")
if a<1200:
  print("ABC")

Solution (Python):
i=int(input())
print('A%sC'%("B"if i<1200 else "R"if i<2800 else"G"))

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 1200 <= 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())
print('ABC' if R<1200 else 'ARC' if R<2800 else 'AGC')

Solution (Python):
R=int(input())
print("A"+["GR"[R<2800],"B"][R<1200]+"C")

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 1200 <= r < 2800:
    print('ARC')
else:
    print('AGC')

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

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

Solution (Python):
n=int(input())
print('ABC' if 0<=n<1200 else 'ARC' if 1200<=n<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):
r = int (input ())
if r >= 2800:
  print ('AGC')
elif r >= 1200:
  print ('ARC')
else:
  print ('ABC')

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):
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):
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    R = ni()
    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<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

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

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

    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):
R = int(input())
if R > 2799:
	print("AGC")
elif R > 1199:
	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):
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 1200 <= n < 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):
r = int(input())
if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')

Solution (Python):
R = int(input())
print(['ABC','ARC','AGC'][(R>=1200)+(R>=2800)])

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());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):
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 1200<=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 1200 <= r < 2800:
    print("ARC")
elif 2800 <= r:
    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')
  exit()
elif r<2800:
  print('ARC')
  exit()
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):
print(["ABC","ARC","AGC"][int(input())//50+8>>5])

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:
  my_result = 'ABC'
elif n >= 1200 and n < 2800:
  my_result = 'ARC'
else:
  my_result = 'AGC'
print(my_result)

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

Solution (Python):
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

r = k()
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):
import sys
input = sys.stdin.readline



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


if __name__ == "__main__":
    main()

Solution (Python):


import math

import itertools
from collections import deque
from collections import Counter
import heapq
from fractions  import gcd


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 1200<=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 calculation(lines):
    R = int(lines[0])
    if R < 1200:
        ret = 'ABC'
    elif R < 2800:
        ret = 'ARC'
    else:
        ret = 'AGC'
    return [ret]



def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['1199']
        lines_export = ['ABC']
    if pattern == 2:
        lines_input = ['1200']
        lines_export = ['ARC']
    if pattern == 3:
        lines_input = ['4208']
        lines_export = ['AGC']
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode



def main():
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

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

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

print(ans)

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):
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 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")
if r>=1200 and r<2800:print("ARC")
if r>=2800: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 < 2800:
    print("ARC")
else:
    print("AGC")

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

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

if r < 1200:
    print('ABC')

elif r < 2800:
    print('ARC')

elif r >= 2800:
    print('AGC')

Solution (Python):
n = int(input())
print("ABC" if n<1200 else "ARC" if n<2800 else "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:
    ans = "ABC"
elif R < 2800:
    ans = "ARC"
else:
    ans = "AGC"
    
print(ans)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

r = int(readline())
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):
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):
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):
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 2800<=a:
  print("AGC")
else:
  print("ARC")

Solution (Python):

def f(r):
	if r < 1200: return 'ABC'
	if r < 2800: return 'ARC'
	return 'AGC'
print f(int(raw_input()))

Solution (Python):
a = int(input())
if a < 1200:
  print("ABC")
elif 1200 <= 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):
def main():
    k=int(input())
    if k < 1200:
        print("ABC")
    elif k < 2800:
        print("ARC")
    else:
        print("AGC")
    
if __name__ == "__main__":
    main()

Solution (Python):
import math
import collections
import fractions
import itertools
import functools
import  operator

def solve():
    r = int(input())
    if r < 1200:
        print("ABC")
        exit()
    if r < 2800:
        print("ARC")
        exit()
    print("AGC")
    return 0

if __name__ == "__main__":
    solve()

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

Solution (Python):
import sys, os, math, bisect, itertools, collections, heapq, queue

from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()

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

main()

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
R = I()
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 resolve():
  r = int(input())
  if r < 1200:
    print('ABC')
  elif r < 2800:
    print('ARC')
  else:
    print('AGC')
  return

if __name__ == "__main__":
  resolve()

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

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