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):
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 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):
print(["ABC","ARC","AGC"][(int(input())+400)//1600])

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

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

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

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

if N <= 1199:
    print("ABC")
elif N <= 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):
A=int(input())
ARC=1
if(A<1200):
  print("ABC")
  ARC=0

if(A>=2800):
  print("AGC")
  ARC=0
  
if(ARC==1):
  print("ARC")

Solution (Python):

import sys

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

Solution (Python):
""" AtCoder """

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

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

Solution (Python):


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

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


    print(r)


if __name__ == '__main__':
    main()

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

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


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):
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<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 0 <= r and r < 1200:
    print('ABC')
elif 1200 <= r and r < 2800:
    print('ARC')
elif 2800 <= r and r <= 4208:
    print('AGC')
else:
    raise ValueError

Solution (Python):
R = int(input())
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())
print("AGC" if r>2799 else("ARC" if r>1199 else"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):
rated = int(input())

if rated < 1200 :
    print("ABC")
elif rated < 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 >= 1200 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());print("A"+["G","R","B"][(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:
    contest = "ABC"
elif r < 2800:
    contest = "ARC"
else:
    contest = "AGC"
print(contest)

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

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

ans = "ABC"
if R >= 1200:
    ans = "ARC"
if R >= 2800:
    ans = "AGC"

print(ans)

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

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

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

def readQuestion():
    line = sys.stdin.readline().rstrip()
    return int(line)
 
def main():
    n = readQuestion()
    answer = solve(n)
    print(answer)
    
if __name__ == '__main__':
    main()

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

Solution (Python):

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

Solution (Python):


import sys

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

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    r = int(ws[0])
    return (r,)

def main():
    solve(*readQuestion())

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


abc104_a()

Solution (Python):

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

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

Solution (Python):



def main():
    """Function."""
    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):
r = int(input())
contest = ['ABC', 'ARC', 'AGC']
if (r < 1200):
    print(contest[0])
elif (r < 2800):
    print(contest[1])
else:
    print(contest[2])

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

if n < 1200:
  print('ABC')
elif 1200 <= n 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())
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 1200 > R:
  print("ABC")
elif 2800 > R:
  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):
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):
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 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 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())
data=(1200,2800)
name=('ABC', 'ARC', 'AGC')

z=[name[0] if r < 1200 else name[1] if data[0] <= r < data[1] else name[2] if data[1] <= r else i for i in range(1)]
print(z[0])

Solution (Python):
r=int(input())
data=(1200,2800)
name=('ABC', 'ARC', 'AGC')

z=[name[0] if r < 1200 else name[1] if 1200 <= r < 2800 else name[2] if 2800 <= r else i for i in range(1)]
print(z[0])

Solution (Python):
r=int(input())
data=(1200,2800)
name=('ABC', 'ARC', 'AGC')

[print(name[0]) for i in range(1) if r < 1200]
[print(name[1]) for i in range(1) if 1200 <= r < 2800 ]
[print(name[2]) for i in range(1) if 2800 <=r ]

Solution (Python):
r=int(input())
data=(1200,2800)
name=('ABC', 'ARC', 'AGC')
if r<data[0]:
  print(name[0])
elif data[0]<=r<data[1]:
  print(name[1])
else:
  print(name[2])

Solution (Python):
r=int(input())
data1=1200
data2=2800
name=('ABC', 'ARC', 'AGC')
if r<data1:
  print(name[0])
elif data1<=r<data2:
  print(name[1])
else:
  print(name[2])

Solution (Python):
r=int(input())
data1=1200
dara2=2800
name=('ABC', 'ARC', 'AGC')
if r<data1:
  print(name[0])
elif data1<=r<2800:
  print(name[1])
else:
  print(name[2])

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

name=('ABC', 'ARC', 'AGC')
if r<1200:
  print(name[0])
elif 1200<=r<2800:
  print(name[1])
else:
  print(name[2])

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

if 0 <= 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 2800 <= R :
    print("AGC")
else:
    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):
n=int(input())
l=["AGC","ARC","ABC"]
print(l[int(n<1200)+int(n<2800)])

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):
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 <= 1199:
    print("ABC")
elif N<= 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):
def solve():
    rating = int(input())

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


if __name__ == '__main__':
    solve()

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 >= 2800:
  print("AGC")
elif n >= 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):
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):
print'A%sC'%'BRG'[input()/50+8>>5]

Solution (Python):
print('A%sC'%'BRG'[int(input())//50+8>>5])

Solution (Python):
r=int(input());print(['ARC'*(r-1199>0)or'ABC','AGC'][r-2799>0])

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

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

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

Solution (Python):
print("A"+"BRG"[int(input())//50+8>>5]+"C")

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

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

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

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

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


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

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


if __name__ == '__main__':
    main()

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

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

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

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 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 = 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):
def rated_for_me(rate):
    if rate < 1200:
        return "ABC"
    if rate < 2800:
        return "ARC"
    return "AGC"

rate = int(input())
print(rated_for_me(rate))

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):
rating = [('ABC', 1200), ('ARC', 2800), ('AGC', 4209)]
r = int(input())
for t in rating:
    if r < t[1]:
        print(t[0])
        break

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

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

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

Solution (Python):

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

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

Solution (Python):
C = ["ABC", "ARC" , "AGC"]
A = int(input())
print(C[(A>1199)+(A>2799)])

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('A'+'BRRGG'[n//1200+n//2800]+'C')

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

"""
A - Rated for Me
https://beta.atcoder.jp/contests/abc104/tasks/abc104_a

"""
import sys
from sys import stdin
input = stdin.readline


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


if __name__ == '__main__':
    main(sys.argv[1:])

Solution (Python):
"""
A - Rated for Me
プログラミングコンペティションサイト AtCode は、プログラミングコンテストを定期的に開催しています。
AtCode で次に開催されるコンテストは ABC と呼ばれ、レーティングが 1200
未満の参加者のレーティングが変動します
その次に開催されるコンテストは ARC と呼ばれ、レーティングが 2800
未満の参加者のレーティングが変動します。
そのさらに次に開催されるコンテストは AGC と呼ばれ、すべての参加者のレーティングが変動します。
高橋くんの AtCode でのレーティングは R
です。彼のレーティングが変動する次のコンテストは何でしょうか？
"""

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

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

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

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

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")
else:
    if 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):
a=int(input());print(["AGC","ARC","ABC"][(a<1200)+(a<2800)])

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