#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;

int main() {
	int R;
	cin >> R;

	if (R < 1200) cout << "ABC" << endl;
	else if (R < 2800) cout << "ARC" << endl;
	else cout << "AGC" << endl;
}
#include <bits/stdc++.h>
using namespace std;

int main(){

string A;
cin >> A;
if(A.at(0)-'0'==7||A.at(1)-'0'==7||A.at(2)-'0'==7) cout << "Yes" << endl;
else cout << "No" << endl;
}