function main(input) {
   input = input.trim();
  const a = input.split(" ").map(Number);
  console.log(a[0]<1200?"ABC"
			:a[0]<2800?"ARC"
			:"AGC");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));