#include <bits/stdc++.h>
using namespace std;
void prepareIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.precision(std::numeric_limits<double>::max_digits10);
}
struct HASH {
  size_t operator()(const pair<long long int, long long int> &x) const {
    return hash<long long>()(x.first ^ (x.second) << 32);
  }
};
const long long int MOD = 1e9 + 7;
const long long int N = 1e5 + 5;
int main() {
  prepareIO();
  long long int n, ignore, sum = 0;
  cin >> n;
  vector<long long int> c(n);
  for (long long int i = 0; i < n; i++) {
    cin >> c[i] >> ignore;
    sum += c[i];
  }
  long long int s1 = 0, s2 = (1000 * n) - sum;
  long long int times = (s2 - s1) / 1000;
  if ((s2 - s1) % 1000 > 500) {
    times++;
  }
  cout << string(times, 'A') << string(n - times, 'G') << "\n";
  return 0;
}
