import Control.Monad
import Control.Applicative

solver :: Int -> String
solver n
    | n < 1200  = "ABC"
    | n < 2800  = "ARC"
    | otherwise = "AGC"

main :: IO ()
main = do
    n <- (read :: String -> Int) <$> getLine
    putStrLn $ solver n
