#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  long n;
  cin >> n;
  long long A = 0, G = 0, a, g;
  string s = "";
  for (long long i = 0; i < n; i++) {
    cin >> a >> g;
    if ((abs((A + a) - G) >= abs(A - (G + g)))) {
      if (abs(A - (G + g)) > 500) {
        cout << -1 << endl;
        return 0;
      }
      G += g;
      s += 'G';
    } else {
      if (abs((A + a) - G) > 500) {
        cout << -1 << endl;
        return 0;
      }
      A += a;
      s += 'A';
    }
  }
  cout << s << endl;
  return 0;
}
