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