#include <bits/stdc++.h>
using namespace std;
string get_string(vector<pair<int, int> > vp, int n) {
  int i, j, sa = 0, sg = 0;
  string result = "";
  for (i = 0; i < n; i++) {
    if (abs((sa + vp[i].first) - sg) > 500 &&
        abs(sa - (sg + vp[i].second)) > 500)
      return "-1";
    if (i == 0) {
      if (vp[i].first < vp[i].second) {
        sa += vp[i].first;
        result += 'A';
      } else {
        sg += vp[i].second;
        result += 'G';
      }
    } else {
      if (abs((sa + vp[i].first) - sg) <= 500) {
        sa += vp[i].first;
        result += 'A';
      } else if (abs(sa - (sg + vp[i].second)) <= 500) {
        sg += vp[i].second;
        result += 'G';
      }
    }
  }
  return result;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int tc, i, val, j, n, m, k, pa, pg;
  cin >> n;
  vector<pair<int, int> > vp;
  for (i = 0; i < n; i++) {
    cin >> pa >> pg;
    vp.push_back(make_pair(pa, pg));
  }
  string s = get_string(vp, n);
  cout << s << "\n";
  return 0;
}
