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