#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  pair<long long, long long> *a = new pair<long long, long long>[n];
  for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  string ans = "";
  long long sa = 0;
  long long sb = 0;
  if (a[0].first <= 500) {
    ans += 'A';
    sa = a[0].first;
  } else {
    ans += 'G';
    sb += a[0].second;
  }
  for (int i = 1; i < n; i++) {
    long long x = sa + a[i].first;
    if (x - sb <= 500) {
      sa = x;
      ans += 'A';
    } else {
      sb += a[i].second;
      ans += 'G';
    }
  }
  if (abs(sa - sb) <= 500)
    cout << ans << endl;
  else
    cout << -1 << endl;
  delete[] a;
  return 0;
}
