#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];
  }
  sort(c.begin(), c.end());
  long long int idx = 0, i = 0, s1 = 0, s2 = (1000 * n) - sum;
  bool found = false;
  while (i < n) {
    if (abs(s1 - s2) <= 500) {
      found = true;
      break;
    }
    if (s1 > s2 + 500) {
      idx = -1;
      break;
    }
    s1 += c[i];
    s2 -= (1000 - c[i]);
    i++;
    idx = i;
  }
  if (abs(s1 - s2) <= 500) {
    found = true;
  }
  if (!found || idx == -1) {
    cout << "-1\n";
    return 0;
  }
  string ans = string(idx, 'A') + string(n - idx, 'G');
  cout << ans << "\n";
  return 0;
}
