{-# OPTIONS_GHC -Wall #-}

readInt :: String -> Int
readInt = read

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

main :: IO ()
main = do
    r <- fmap readInt getLine

    let ans = solve r

    putStrLn ans
