import scala.io.StdIn._
object Main extends App{
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt
  if(n<1200){
    print("ABC")
  }
  else if(n<2800){
    print("ARC")
  }
  else{
    print("AGC")
  }
}