#!/usr/bin/env python3

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