#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
int main() {
  long long int i, n, q, mn = INT_MAX, mx = 1, k, f = 0, j, wt, a, b = -1, c, t,
                         sum = 0, val = 0;
  cin >> n;
  int diff = 0;
  string s = "";
  for (i = 0; i < n; i++) {
    cin >> a >> b;
    if (abs(a + diff) <= 500) {
      s += 'A';
      diff += a;
    } else {
      s += 'G';
      diff -= b;
    }
  }
  if (abs(diff) <= 500)
    cout << s;
  else
    cout << -1;
}
