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