#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
long long logPow(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    if (b & 1) {
      ans *= a;
    }
    a *= a;
    b = b >> 1;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int sa = 0, sb = 0, ap, bp, sum = 0;
  vector<pair<int, int> > vt;
  for (int i = 0; i < n; i++) {
    cin >> ap >> bp;
    vt.push_back(make_pair(ap, bp));
    sa += ap;
  }
  vector<int> arr_b;
  int i;
  for (i = 0; i < n; i++) {
    if (abs(sa - sb) <= 500) {
      break;
    } else {
      sa -= vt[i].first;
      sb += vt[i].second;
      arr_b.push_back(i);
    }
  }
  if (i == n && abs(sa - sb) > 500) {
    cout << -1 << "\n";
    return 0;
  }
  int j = 0;
  for (int i = 0; i < n; i++) {
    if (j < arr_b.size() && arr_b[j] == i) {
      cout << "G";
      j++;
    } else {
      cout << "A";
    }
  }
  return 0;
}
