#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<pair<int, int>> v;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    v.push_back(make_pair(a, b));
  }
  string ats;
  long long A = 0, G = 0;
  for (int i = 0; i < n; i++)
    if (abs((A + v[i].first) - G) <= 500)
      A += v[i].first, ats += "A";
    else
      G += v[i].second, ats += "G";
  cout << ats;
  return 0;
}
