#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int u = 0, v = 0;
  int c = 0;
  vector<char> s;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    if (abs(a + u - v) <= 500) {
      u = a + u;
      char f = 'A';
      s.push_back(f);
    } else if (abs(b + v - u) <= 500) {
      v = v + b;
      char f = 'G';
      s.push_back(f);
    } else {
      c = -1;
    }
  }
  if (c != -1) {
    for (int i = 0; i < s.size(); i++) {
      cout << s[i];
    }
  }
  return 0;
}
