#include <map>
#include <climits>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
using namespace std;
#define len(a) (int)a.size()
#define printii(a, b) printf("%d %d\n", a, b)
#define printiii(a, b, c) printf("%d %d %d\n", a, b, c)
#define printiiii(a, b, c, d) printf("%d %d %d %d\n", a, b, c, d)
#define printi(a) printf("%d\n", a); fflush(stdout)
#define printl(a) printf("%lld\n", a)
#define printlll(a, b, c) printf("%lld %lld %lld\n", a, b, c);
#define printArr(a, len) for (int i = 0; i < len; i++) printf("%d ", a[i]); printf("\n")
#define printv(a) for (int i = 0; i < len(a); ++i) printf("%d ", a[i]); printf("\n")
#define printLArr(a, len) for (int i = 0; i < len; i++) printf("%lld ", a[i]); printf("\n")
#define printd(a) printf("%f\n", a)
#define printll(a, b) printf("%lld %lld\n", a, b)
#define prints(a) printf("%s\n", a.c_str())
#define printiiiii(a, b, c, d, e) printf("%d %d %d %d %d\n", a, b, c, d, e)
#define printil(a, b) printf("%d %lld\n", a, b);
#define printld(a) printf("%.12Lf\n", a);
#define printiil(a, b, c) printf("%d %d %lld\n", a, b, c)
#define readi(a) scanf("%d", &a)
#define readii(a, b) scanf("%d%d", &a, &b)
#define readiii(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define readl(a) scanf("%lld", &a)
#define readll(a, b) scanf("%lld%lld", &a, &b)
#define readlll(a, b, c) scanf("%lld%lld%lld", &a, &b, &c)
#define readil(a, b) scanf("%d%lld", &a, &b)
#define readArr(a, len) for (int i = 0; i < len; readi(a[i++]))
#define readiiii(a, b, c, d) scanf("%d%d%d%d", &a, &b, &c, &d)
#define reads(a) scanf("%s", a);
#define readli(a, b) scanf("%lld%d", &a, &b)
#define readd(a) scanf("%f", &a)
#define for0(a) for (int i = 0; i < a; i++)
#define for1(a) for (int i = 1; i <= a; i++)
#define eb emplace_back
#define ee emplace
#define pb push_back
#define ins insert
#define sortv(a) sort(a.begin(), a.end())
#define LoL printf("LoL\n");
#define YES printf("YES\n");
#define NO printf("NO\n");
#define END return 0;
#define mem(a) resize(a)
#define meme(a, b) resize(a, b)
#define NL printf("\n");
#define readc(a) scanf("%c", &a);
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector< pair<int, int> > vii;
typedef vector< pair<ll, ll> > vll;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<vs> vvs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
const int maxN = (int)3e5, maxM = (int)2e3, intMax = INT_MAX, maxValue = (int)1e4, intInf = (int)1e9, mod = (int)1e9 + 7, www = 97;
const ll llmax = LLONG_MAX, INF = (ll)1e9+1;
ll nod(ll a, ll b) {
    while (a != 0 && b != 0) {
        if (a < b)
            b %= a;
        else
            a %= b;
    }
    return a + b;
}
int nod(int a, int b) {
    while (a != 0 && b != 0) {
        if (a < b)
            b %= a;
        else
            a %= b;
    }
    return a + b;
}
ll nok(ll a, ll b) {
    return a * b / nod(a, b);
}
int nok(int a, int b) {
    return a * b / nod(a, b);
}
ll modPlus(ll a, ll b) {
    return ((a % mod) + (b % mod)) % mod;
}
int modPlus(int a, int b) {
    return ((a % mod) + (b % mod)) % mod;
}
ll binPow(ll a, ll b) {
    ll res = 1;
    while (b) {
        if (b % 2 == 1)
            res = (res * a) % mod;
        a = (a * a) % mod;
        b >>= 1;
    }
    return res;
}
double binPow(double a, ll b) {
    double res = 1;
    while(b) {
        if (b % 2 == 1) {
            res *= a;
            while (res >= mod) res -= mod;
        }
        a *= a;
        while (a >= mod) a -= mod;
        b >>= 1;
    }
    return res;
}
ll mulmod(ll a, ll b) {
    ll res = 0;
    a = a % mod;
    while (b > 0) {
        if (b % 2 == 1)
            res = (res + a) % mod;
        a = (a * 2) % mod;
        b /= 2;
    }
    return res % mod;
}
pii max(pii a, pii b) {
    if (a.first > b.first)
        return a;
    if (a.first < b.first)
        return b;
    if (a.second > b.second)
        return a;
    return b;
}
pii min(pii a, pii b) {
    if (a.first < b.first)
        return a;
    if (a.first != b.first)
        return b;
    if (a.second < b.second)
        return a;
    return b;
}



int main() {

    int n;
    readi(n);
    if (n < 1200)
        printf("ABC");
    else if (n < 2800)
        printf("ARC");
    else
        printf("AGC");

    END
}

Measured memory_bytes: 256