import sys

ri = lambda: int(sys.stdin.readline())

a = ri()

if a < 1200:

  print('ABC')

elif a < 2800:

  print('ARC')

else:

  print('AGC')
import sys

ri = lambda: int(sys.stdin.readline())



a = ri()

if a < 1200:

  print('ABC')

else:

  print(('ARC' if a < 2800 else 'AGC'))
import sys

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

import sys

ri = lambda: int(sys.stdin.readline())
a = ri()
if a < 1200:
    print("ABC")
else:
    print(("ARC" if a < 2800 else "AGC"))

-elif a < 2800: -    print("ARC") -    print("AGC") +    print(("ARC" if a < 2800 else "AGC"))