#include <bits/stdc++.h>
using namespace std;
void read() {}
int main() {
  read();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    int counta = 0, countg = 0, a, g;
    vector<char> v;
    while (n--) {
      cin >> a >> g;
      counta += a;
      v.push_back('A');
      if (counta - countg <= 500) {
        continue;
      } else {
        v.pop_back();
        v.push_back('G');
        counta -= a;
        countg += g;
      }
    }
    for (int i = 0; i < v.size(); i++) cout << v[i];
    cout << endl;
  }
  return 0;
}
