#include <bits/stdc++.h>
using namespace std;
string s;
int t;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int a, g;
  int sumG = 0, sumA = 0;
  n--;
  cin >> a >> g;
  if (sumA + a - sumG < 500) {
    sumA += a;
    cout << 'A';
  } else {
    sumG += g;
    cout << 'G';
  }
  while (n--) {
    cin >> a >> g;
    if (sumA + a - sumG < 500) {
      sumA += a;
      cout << 'A';
    } else {
      sumG += g;
      cout << 'G';
    }
  }
}
