#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n;
  cin >> n;
  vector<pair<long long, long long>> a(n);
  long long sum1 = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
    sum1 += a[i].first;
  }
  long long sum2 = 0;
  string s = "";
  for (long long i = 0; i < n; i++) s += 'A';
  if (sum1 <= 500)
    cout << s;
  else {
    long long i = 0;
    long long dif = sum1;
    long long co = 0;
    while (i < n) {
      sum1 -= a[i].first;
      sum2 += a[i].second;
      long long dif1 = abs(sum1 - sum2);
      if (dif < dif1) {
        sum1 += a[i].first;
        sum2 -= a[i].second;
      } else if (dif1 <= 500) {
        s[i] = 'G';
        co++;
        break;
      } else {
        s[i] = 'G';
        dif = dif1;
      }
      i++;
    }
    if (co == 0)
      cout << -1;
    else {
      cout << s;
    }
  }
  return 0;
}
