function Main(input) {
  const contest = ['ABC', 'ARC', 'AGC']
  var i = 0
  var r = Number(input[0])
  if (r >= 1200) { i++ }
  if (r >= 2800) { i++ }
  console.log(contest[i])
}


Main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'))
