#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, k, t, suma = 0, sumg = 0;
  cin >> n;
  long long int a[n], b[n];
  string s;
  for (long long int i = 0; i <= n - 1; i++) {
    cin >> a[i] >> b[i];
    if (((suma + a[i]) - sumg) > 500) {
      sumg += b[i];
      s += 'G';
    } else {
      suma += a[i];
      s += 'A';
    }
  }
  cout << s << endl;
}
