#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    long long int n;
    cin >> n;
    long long int x, y, i;
    long long int suma = 0, sumb = 0;
    bool found = false;
    vector<char> v;
    for (i = 0; i < n; i++) {
      cin >> x >> y;
      suma += x;
      if (abs(suma - sumb) <= 500 && !found)
        v.push_back('A');
      else {
        suma -= x;
        sumb += y;
        if (abs(suma - sumb) <= 500 && !found)
          v.push_back('G');
        else
          found = true;
      }
    }
    if (found)
      cout << "-1\n";
    else {
      for (i = 0; i < v.size(); i++) cout << v[i];
      cout << "\n";
    }
  }
  return 0;
}
