'use strict' 

function main(input) {
  //ABC, ARC, AGC
  input = ~~input.split('\n')[0]

  let ans = 'AGC'
  if (input < 1200) {
    ans = 'ABC'
  } else if (input < 2800) {
    ans = 'ARC'
  }

  console.log(ans)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))