function Main(input) {
    var lines = input.split('\n');
    var R = +lines[0];
    var ans;
    if (R < 1200) {
        ans = 'ABC';
    } else if (R < 2800) {
        ans = 'ARC';
    } else {
        ans = 'AGC';
    }
    console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));