

import collections





def solve():

    R = int(eval(input()))



    if R < 1200:

        print("ABC")

    elif R < 2800:

        print("ARC")

    else:

        print("AGC")





if __name__ == "__main__":

    solve()

R = int(eval(input()))

if R < 1200:

    print("ABC")

elif R < 2800:

    print("ARC")

else:

    print("AGC")

import collections


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


if __name__ == "__main__":
    solve()

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

-import collections - - -def solve(): -    R = int(eval(input())) -    if R < 1200: -        print("ABC") -    elif R < 2800: -        print("ARC") -    else: -        print("AGC") - - -if __name__ == "__main__": -    solve() +R = int(eval(input())) +if R < 1200: +    print("ABC") +elif R < 2800: +    print("ARC") +else: +    print("AGC")