#include <bits/stdc++.h>
using namespace std;
class _282B {
 public:
  void solve() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    ;
    int t, toa = 0, tog = 0, a, g;
    cin >> t;
    while (t--) {
      cin >> a >> g;
      if (abs(toa + a - tog) <= 500)
        cout << "A", toa += a;
      else
        cout << "G", tog += g;
    }
  }
};
int main() {
  _282B ob;
  ob.solve();
  return 0;
}
