function Main(input) {
  input = input.trim()
  if(input>2800){
  console.log("AGC")
  }else if(input>1200){
  console.log("ARC")
  }else{
  console.log("ABC")
  }
}Main(require("fs").readFileSync("/dev/stdin", "utf8"));