object Main {
  def main(args:Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    val r = sc.nextInt
    println(
      if(r < 1200) "ABC"
      else if(r < 2800) "ARC"
      else "AGC"
    )
  }
}