#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void s() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  s();
  long long n;
  cin >> n;
  long long sa = 0, sg = 0;
  long long a[n], g[n];
  string res = "";
  for (long long i = 0; i < n; i++) {
    cin >> a[i] >> g[i];
    if (abs(sa - sg) > 500) {
      res += "G";
      sg += g[i];
    } else {
      sa += a[i];
      if (abs(sa - sg) > 500) {
        sa -= a[i];
        sg += g[i];
        res += "G";
        continue;
      }
      res += "A";
    }
  }
  if (abs(sa - sg) > 500)
    cout << -1 << "\n";
  else
    cout << res << "\n";
  return 0;
}
