import scala.io.{StdIn => in}

object Main extends App {
  val r = in.readInt

  val ans = r match {
    case r if r < 1200 => "ABC"
    case r if r < 2800 => "ARC"
    case _ => "AGC"
  }
  println(ans)
}