'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const r = parseInt(args[0][0], 10)
	if (r < 1200) console.log('ABC')
	else if (r < 2800) console.log('ARC')
	else console.log('AGC')
}

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