'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', function(inputStdin) {
    inputString += inputStdin;
});

process.stdin.on('end', function() {
    inputString = inputString.split('\n');

    main();
});

function readline() {
    return inputString[currentLine++];
}


function main() {

    var r = Number(readline())
    if(r < 1200) console.log('ABC');
    else if(r < 2800) console.log('ARC');
    else console.log('AGC');
}

//
