#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1e6 + 1;
void solve() {
  long long n;
  cin >> n;
  string ans = "";
  long long s = 0;
  for (long long i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    s += a;
  }
  long long pos;
  for (long long i = 0; i < n; i++) {
    long long temp = s - i * (1000);
    if (temp <= 500 && temp >= -500) {
      pos = i;
      break;
    }
  }
  for (long long i = 0; i < pos; i++) {
    cout << "G";
  }
  for (long long i = pos; i <= n - 1; i++) {
    cout << "A";
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
}
