#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a = 0, g = 0;
  cin >> n;
  string ans = "";
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    if (fabs(a + x - g) <= fabs(g + y - a)) {
      ans += 'A';
      a += x;
    } else {
      ans += 'G';
      g += y;
    }
  }
  if (fabs(a - g) <= 500) {
    cout << ans;
  } else
    cout << -1;
  return 0;
}
