import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons;

void main() {
    const R = readln.chomp.to!int;
    writeln(R < 1200 ? "ABC" : R < 2800 ? "ARC" : "AGC");
}

