function main(input) {
  const r = parseInt(input.trim(), 10)

  if (r >= 2800) {
    console.log('AGC')
  } else if (r >= 1200) {
    console.log('ARC')
  } else {
    console.log('ABC')
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))