import scala.io.StdIn._
object Main{
  def main(args: Array[String]): Unit = {
    val r = readLine.toInt
    if(r<1200)
      println("ABC")
    else if(r < 2800)
      println("ARC")
    else
      println("AGC")
  }
}
