#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;
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int r; cin >> r;
  if(r < 1200) cout << "ABC" << "\n";
  else if(r < 2800) cout << "ARC" << "\n";
  else cout << "AGC" << "\n";
  return 0;
}
