module Main where

main :: IO ()
main = do
    r <- fmap read getLine
    putStrLn $ ratedForMe r

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