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