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

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

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

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

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

Solution (Python):
import numpy as np

r = int(input())

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

Solution (Python):
n=int(input())
if(n<=1199):
    print("ABC")
else:
    print("ARC" if n<=2799 else "AGC")

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

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()

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:
    ans = "ABC"
elif R < 2800:
    ans = "ARC"
else:
    ans = "AGC"

print(ans)

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

Solution (Python):
ans = ['ABC', 'ARC', 'AGC']
R = int(input())

if R < 1200:
    i = 0
elif R < 2800:
    i = 1
else:
    i = 2
print(ans[i])

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

Solution (Python):


import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

R = ni()

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("AGC")
else:
  print('ARC')

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

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

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

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

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

if 1200>R:
  print('ABC')
elif 2800>R:
  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):









import sys



ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

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

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")
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):
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>=1200 and n<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):
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):
x = int(input())
if x < 1200:
  print('ABC')
elif 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 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


def solve(R: int):
    if R < 1200:
        return 'ABC'
    if R < 2800:
        return 'ARC'
    else:
        return 'AGC'



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    R = int(next(tokens))  
    print(solve(R))

if __name__ == '__main__':
    main()

Solution (Python):


R = int(input().strip())

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

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(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):
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())
n=0 if r<1200 else 1 if r<2800 else 2
print(['ABC','ARC','AGC'][n])

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

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

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):
r = int(input())
if  r >= 2800:
    print('AGC')
elif r < 2800 and 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):
n=int(input())
if n>=2800:
    k=2
elif n>=1200:
    k=1
else:
    k=0
print(['ABC','ARC','AGC'][k])

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

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

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

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

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

Solution (Python):
r = int(input())
print("ABC"*(r<1200) or "ARC"*(r<2800) or "AGC")

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

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

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


if __name__ == '__main__':
    main()

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

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

Solution (Python):
r=int(input())
if r<1200:
  print("ABC")
elif r in range(1200,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')


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("AGC")
else: print("ARC")

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

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

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

Solution (Python):
print('A{}C'.format('BRG'[(int(input())+400)//1600]))

Solution (Python):
print('A'+'BRG'[(int(input())+400)//1600]+'C')

Solution (Python):
print(['ABC','ARC','AGC'][(int(input())+400)//1600])

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

Solution (Python):
import sys
r=int(input())
if r<1200:
	print("ABC")
	sys.exit()
elif r<2800:
	print("ARC")
	sys.exit()
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):
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):

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n = int(readline().split()[0])
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 >= 1200 and R < 2800:
    print("ARC")
    
elif R >= 2800:
    print("AGC")

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

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

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

Solution (Python):
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys



read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

R = int(readline())
print('ABC' if R < 1200 else 'ARC' if R < 2800 else 'AGC')

Solution (Python):
x=int(input())
if x<1200:
    print("ABC")
elif 1200<=x and 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):
num = int(input())
if (num < 1200):
  print("ABC")
elif (num < 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):
n = int(input())

if 0 <= n <= 1199:
    print("ABC")
elif 1200 <= n <= 2799:
    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):
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:
    x = 'ABC'
elif r < 2800:
    x = 'ARC'
else:
    x = 'AGC'
print(x)

Solution (Python):
r = int(input().strip())
if 0 <= 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 >= 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 >= 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):
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 1200 <= 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 1200 <= 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):
def main():
    from sys import stdin, setrecursionlimit
    setrecursionlimit(10**6)
    r = stdin.readline()[:-1]
    
    
    

    r = int(r)
    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):

n = int(input())
print((["ABC"]*12+["ARC"]*16+["AGC"]*15)[int(n/100)])

Solution (Python):
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())

sys.setrecursionlimit(10 ** 9)


def main():
    R = INT()

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

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

main()

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

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

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

Solution (Python):
def examA():
    R = I()
    if R<1200:
        ans = "ABC"
    elif R<2800:
        ans = "ARC"
    else:
        ans = "AGC"
    print(ans)
    return

def examB():
    return

def examC():
    return

def examD():
    return

def examE():
    return

def examF():
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examA()

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

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):
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")
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"+["B","R","G"][(R>=1200)+(R>=2800)]+"C")

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):
r=int(input())

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

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

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

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

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

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

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

if r < 1200:
    print('ABC')
    exit()

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

Solution (Python):
R = int(input())
if 0 <= 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):
n=int(input())
if n < 1200:
  print('ABC')
elif 1199 < n < 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):
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):
import sys
input = sys.stdin.readline
R = int(input())
if R < 1200 :
    print("ABC")
elif R >= 1200 and R < 2800 :
    print("ARC")
else :
    print("AGC")

Solution (Python):
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

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

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7



r = int(sys.stdin.buffer.readline())
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):
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 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")