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

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

Solution (Python):
import sys
from collections import defaultdict, deque, Counter
import math


from bisect import bisect_left, bisect_right
import heapq




input = sys.stdin.readline

getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = 10 ** 20
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)


def nck(n, k, kaijyo):
    return (npk(n, k, kaijyo) * divide(kaijyo[k])) % MOD


def npk(n, k, kaijyo):
    if k == 0 or k == n:
        return n % MOD
    return (kaijyo[n] * divide(kaijyo[n-k])) % MOD


def kaijyo(n):
    ret = [1]
    for i in range(1, n + 1):
        ret.append((ret[-1] * i)% MOD)
    return ret


def solve():
    n = getN()

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


def main():
    n = getN()
    for _ in range(n):
        solve()


if __name__ == "__main__":
    
    solve()

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

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

Solution (Python):
import sys

def I(): return int(sys.stdin.readline().rstrip())

R = I()

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

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

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

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

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

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

if not (0 <= R <= 4208):
    sys.exit()

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):
import sys
ri = lambda: int(sys.stdin.readline())

a = ri()
if a < 1200:
  print('ABC')
  exit()
print('ARC' if a < 2800 else 'AGC')

Solution (Python):
import sys
ri = lambda: int(sys.stdin.readline())

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

Solution (Python):
import sys
ri = lambda: int(sys.stdin.readline())
a = ri()
if a < 1200:
  print('ABC')
elif a < 2800:
  print('ARC')
else:
  print('AGC')

Solution (Python):
import sys
ri = lambda: int(sys.stdin.readline())

a = ri()
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())
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")
else:
    print("AGC")

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

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

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

Solution (Python):
r=int(input());print("ABC" if r<1200 else "ARC" if 1200<=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())
print("ABC" if R < 1200 else "ARC" if R < 2800 else "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())
print(["ABC","ARC","AGC"][(r+400)//1600])

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):
print(f"A{'BRG'[int(input())//50+8>>5]}C")

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 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 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:S='B'
elif R<2800:S='R'
else:S='G'
print('A'+S+'C')

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

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

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

Solution (Python):
import sys

input = sys.stdin.readline


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

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

    print(ans)


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

Solution (Python):
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy

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

if __name__ == "__main__":
    main()

Solution (Python):
def main():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = (lambda: (sys.stdin.readline()).rstrip())
    input_list = (lambda: input().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    R = input_number()
    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())

txt="AGC"
if R<1200:
    txt="ABC"
elif R<2800:
    txt="ARC"

print(txt)

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

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

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

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

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

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

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

Solution (Python):
r = int(input())
if r < 1200:
    print('ABC')
elif 1200 <= 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())
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):
import sys
from collections import deque
def input(): return sys.stdin.readline().strip()


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

if __name__ == "__main__":
    main()

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 < 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')
elif 2800 <= r and r <=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):
import sys
def input():
    return sys.stdin.readline()[:-1]
def main():
    N = int(input())


    if N < 1200:
        print("ABC")
    elif N < 2800:
        print("ARC")
    else:
        print("AGC")
if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
def actual(r):
    if 0 <= r < 1200:
        return 'ABC'

    if 1200 <= r < 2800:
        return 'ARC'

    return 'AGC'

r = int(input())
print(actual(r))

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

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 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())
a = "G"
if r < 1200:
  a = "B"
elif r < 2800:
  a = "R"
print("A{}C".format(a))

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 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):
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):
from sys import  stdin
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 "AGC" if r>=2800 else "ARC")

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

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

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

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

Solution (Python):



r = int(input())
ans = 'AGC'
if r < 1200: ans = 'ABC'
if 1200 <=r and r < 2800: ans = 'ARC'
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())
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())
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):
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 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):
def resolve():
	r = int(input())
	if r < 1200:
		return print('ABC')
	if r < 2800:
		return print('ARC')
	else:
		return print('AGC')
resolve()

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


if __name__ == "__main__":
    main()

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

Solution (Python):

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

R = ir()
target = np.array([1200, 2800])
i = np.searchsorted(target, R, side='right')
answer = ['ABC', 'ARC', 'AGC'][i]
print(answer)

Solution (Python):

import sys
from bisect import bisect_left, bisect_right

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

R = ir()
target = [1200, 2800]
i = bisect_right(target, R)
answer = ['ABC', 'ARC', 'AGC'][i]
print(answer)

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

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18


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

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

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

Solution (Python):
R = int(input())
if R< 1200:
  print('ABC')

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

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

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

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

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

Solution (Python):

"""
Created on Wed May 13 16:12:33 2020

@author: shinba
"""

r = int(input())

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

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

if __name__ == "__main__":
    print(q1())

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

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

ans = ['ABC', 'ARC', 'AGC']

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

Solution (Python):
import sys
import math
import bisect

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

if __name__ == "__main__":
    main()

Solution (Python):
r=int(input())
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):
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):
import sys
sys.setrecursionlimit(100000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

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 = ""

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


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

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

if __name__ == '__main__':

    ABC_104_A()

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

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

Solution (Python):

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

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

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