#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int g[n];
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> g[i] >> g[i];
    sum += g[i];
  }
  int count = sum / 1000;
  if (sum % 1000 > 500) {
    count++;
  }
  for (int i = 0; i < count; i++) {
    cout << "A";
  }
  for (int i = count; i < n; i++) {
    cout << "G";
  }
  cout << "\n";
}
