#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 100000;
int n, m, a, b;
int main() {
  cin >> n;
  a = b = 0;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    if (abs(a + x - b) < abs(b + y - a)) {
      cout << "A";
      a += x;
    } else {
      cout << "G";
      b += y;
    }
  }
  return 0;
}
