R=int(eval(input()))

if R<1200:

  print('ABC')

elif R<2800:

  print('ARC')

else:

  print('AGC')
# -*- coding: utf-8 -*-

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

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

# -*- coding: utf-8 -*-
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")

-R = int(eval(input())) -if R < 1200: -    print("ABC") -elif R < 2800: +# -*- coding: utf-8 -*- +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("AGC") +    print("ABC")