object Main extends App {
  val sc = new java.util.Scanner(System.in)
//  val l = List.fill(3)(sc.nextInt)
  val r = sc.nextInt

  val ans =
    if (r < 1200) "ABC"
    else if(r < 2800) "ARC"
    else "AGC"

  println(ans)
}