#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using P = pair<int, int>;
#define debug(var) cerr << "[" << #var << "] " << var << endl
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
const ll mod = 1000000007;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};


int main(){
    int n;
    cin >> n;
    string ans = "AGC";
    if (n<1200) ans = "ABC";
    else if (n<2800) ans = "ARC";
    
    cout << ans << endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
typedef long long ll;
template<typename T> bool chmax(T &a, T b) {if(a <= b){a = b; return true;}return false;}
template<typename T> bool chmin(T &a, T b) {if(a >= b){a = b; return true;}return false;}

#define ABC 001
#define ARC 010
#define AGC 100

int main(void){
    int r;
    cin >> r;
    int frag = AGC;
    if(r < 1200){
        frag |= ABC;
        frag |= ARC;
    }else if( r < 2800){
        frag |= ARC;
    }
    if(frag & ABC)cout << "ABC" << endl;
    else if(frag & ARC)cout << "ARC" << endl;
    else cout << "AGC" << endl;
}