module Main where

import Control.Applicative
import Control.Monad

main :: IO ()
main = do
    r <- readLn
    case r of
        _ | r < 1200 -> putStrLn "ABC"
          | r < 2800 -> putStrLn "ARC"
          | otherwise -> putStrLn "AGC"