#include <bits/stdc++.h>
using namespace std;
const int maxn = 10001;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int n;
  cin >> n;
  int a[n], g[n];
  int sa = 0, sg = 0;
  for (int i = 0; i < n; i++) cin >> a[i] >> g[i];
  string ans = "";
  int dif = 0;
  for (int i = 0; i < n; i++) {
    if (dif + a[i] <= 500) {
      ans += 'A';
      dif += a[i];
    } else {
      ans += 'G';
      dif -= g[i];
    }
    if (abs(dif) > 500) {
      cout << -1;
      return 0;
    }
  }
  cout << ans;
  return 0;
}
