#include <bits/stdc++.h>
using namespace std;
int n, x, y, sum = 0;
vector<char> v;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    if (x + sum <= 500) {
      sum += x;
      v.push_back('A');
    } else {
      sum -= y;
      v.push_back('G');
    }
  }
  for (int i = 0; i < n; i++) cout << v[i];
  cout << endl;
  return 0;
}
