function Main(input) {
  R = Number(input);
  if (R < 1200) ans = "ABC";
  else if (R < 2800) ans = "ARC";
  else ans = "AGC";
  console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));