function Main(input) {
    if (input < 1200) {
        input = Math.floor(Math.random() * (input + 1));
        console.log('ABC');
    }
    if (input >= 1200 && input < 2800) {
        input = Math.floor(Math.random() * (input + 1));
        console.log('ARC');
    }
    if (input <= 4208) {
        input = Math.floor(Math.random() * (input + 1));
        console.log('AGC');
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));