function main(arg) {
    arg = parseInt(arg);
    
    if( arg < 1200 ){
        console.log("ABC");
    } else if( arg < 2800 ) {
        console.log("ARC")
    } else {
        console.log("AGC")
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));