import Control.Applicative
import Control.Monad
import Data.List
import Data.Array
import Data.Char

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