{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}

main :: IO ()
main = do
  r <- readLn
  putStrLn $ solve r

solve :: Int -> String
solve r
  | r < 1200 = "ABC"
  | r < 2800 = "ARC"
  | otherwise = "AGC"
