import Control.Monad

main :: IO ()
main = putStr "A" >> readLn >>= putStr . solve >> putStrLn "C" 
    where
        solve r
            | r < 1200 = "B"
            | r < 2800 = "R"
            | otherwise = "G"