#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long num, iA, iG, sumA = 0, sumG = 0;
  string s;
  cin >> num;
  for (int i = 0; i < num; i++) {
    cin >> iA >> iG;
    if (sumA + iA > 500 + sumG) {
      sumG += iG;
      cout << "G";
    } else {
      sumA += iA;
      cout << "A";
    }
  }
  cout << endl;
  return 0;
}
