function Main(input){
  var R = input.trim();
  R = parseInt(R,10);

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

