#include <bits/stdc++.h>
using namespace std;
string s = "";
int main() {
  int n;
  cin >> n;
  int A = 0, B = 0;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    if (A + a - B > B + b - A) {
      B += b, s += "G";
    } else
      A += a, s += "A";
  }
  if (abs(A - B) > 500) {
    cout << -1 << endl;
  } else {
    cout << s << endl;
  }
}
