function Main(input) {
  input = input.split("\n");
  var r = parseInt(input[0].split(" ")[0]);
  var ans = "AGC";
  if(r<1200){
    ans = "ABC";
  }else if(r<2800){
    ans = "ARC";
  }
  console.log('%s', ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));