import Debug.Trace



main :: IO ()
main = do
    r <- read <$> getLine
    -- print n
    putStrLn $ 
        if r < 1200 then 
            "ABC"
        else if r < 2800 then 
            "ARC"
        else
            "AGC"