#include <bits/stdc++.h>
using namespace std;
const int oo = (int)1e9;
const long long OO = 1e18;
const int N = 1e5 + 5;
void Suhaib_Sawalha() {
  string ans;
  long long n;
  cin >> n;
  vector<pair<long long, long long>> v(n);
  long long sumA(0), sumG(0);
  for (long long i = 0; i < n; ++i)
    cin >> v[i].first >> v[i].second, sumA += v[i].first, ans += 'A';
  for (long long i = 0; i < n; ++i) {
    if (sumA - sumG > 500)
      sumA -= v[i].first, sumG += v[i].second, ans[i] = 'G';
    else
      break;
  }
  if (abs(sumA - sumG) > 500)
    cout << "-1";
  else
    cout << ans;
}
void Suhaib_Sawalha1() {
  long long t;
  cin >> t;
  while (t--) {
    Suhaib_Sawalha();
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  Suhaib_Sawalha();
  return 0;
}
