'use strict';

const ABC_LIMIT = 1200;
const ARC_LIMIT = 2800;

const process = input => {
    if (input < ABC_LIMIT) {
        return 'ABC';
    } else if (input < ARC_LIMIT) {
        return 'ARC';
    }

    return 'AGC';
}

console.log(process(parseInt(require("fs").readFileSync("/dev/stdin", "utf8").trim())));