#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, g;
  cin >> n;
  long long int sum1 = 0, sum2 = 0;
  string str = "";
  for (int i = 0; i < n; i++) {
    cin >> a >> g;
    if (sum1 + a <= sum2 + g) {
      if (sum1 + a > sum2)
        if (sum1 + a - sum2 > 500) {
          sum2 += g;
          str += 'G';
          continue;
        }
      sum1 += a;
      str += 'A';
    } else {
      if (sum2 + g > sum1)
        if (sum2 + g - sum1 > 500) {
          sum1 += a;
          str += 'A';
          continue;
        }
      sum2 += g;
      str += 'G';
    }
  }
  if ((sum1 - sum2) >= -500 && (sum1 - sum2) <= 500)
    cout << str << '\n';
  else
    cout << "-1" << '\n';
  return 0;
}
