import Control.Monad
import Data.List
import Data.Maybe
import qualified Data.ByteString.Char8 as B

main :: IO ()
main = do
    [r] <- sort . map (fst . fromJust . B.readInt) . B.words <$> B.getLine :: IO [Int]
    putStrLn (case (r<1200, r<2800) of
        (True,_) -> "ABC"
        (_,True) -> "ARC"
        _        -> "AGC")