import Control.Applicative
import Control.Monad
import Data.List


main = do
    r <- readLn
    putStrLn $ ans r

ans :: Int -> String
ans r
    | r < 1200 = "ABC"
    | r < 2800 = "ARC"
    | otherwise = "AGC"
