import java.util.Scanner

object Main {
  val sc = new Scanner(System.in)
  def main(args: Array[String]): Unit = taskA

  def taskA(): Unit = {
    val r = sc.nextInt
    println(if (r < 2000) "ABC" else if (r < 2800) "ARC" else "AGC")
  }

  def taskB(): Unit = {
  }
}
