const main = function(input){
  var rate = parseInt(input);
  
  if(rate<1200){
  	console.log("ABC");
  }else if(rate<2800){
  	console.log("ARC");
  }else{
  	console.log("AGC");
  }


}



main(require("fs").readFileSync("/dev/stdin","utf-8");