function Main (i) {
  var rate = parseInt(i);
  if (rate < 1200) return console.log('%s','ABC');
  if (rate < 2800) return console.log('%s','ARC');
  console.log('%s','AGC');
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));