#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i].first >> v[i].second;
  }
  long long sum = 0, sum2 = 0;
  string s = "";
  for (int i = 0; i < n; i++) {
    if (abs(sum2 + v[i].second - sum) <= 500) {
      s += "G";
      sum2 += v[i].second;
    } else {
      s += "A";
      sum += v[i].first;
    }
  }
  if (abs(sum - sum2) <= 500) {
    cout << s;
    return 0;
  }
  cout << -1;
}
