import std.conv;
import std.stdio;
import std.string;

void main()
{
	auto r = readln.strip.to!int;
	writeln( solve( r ) );
}

auto solve( in int r )
{
	if( r < 1200 ) return "ABC";
	if( r < 2800 ) return "ARC";
	return "AGC";
}
