function Main (input) {
  var tmp = parseInt(input);
  if (tmp < 1200) return console.log('%s','ABC');
  if (tmp < 2800) return console.log('%s','ARC');
  console.log('%s','AGC');
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));