#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, a, b, pa = 0, push_back = 0;
  string s = "";
  cin >> n;
  while (n--) {
    cin >> a >> b;
    if (abs(pa + a - push_back) <= abs(push_back + b - pa)) {
      pa += a;
      s += "A";
    } else {
      push_back += b;
      s += "G";
    }
  }
  if (abs(pa - push_back) <= 500) {
    cout << s;
    return 0;
  }
  cout << -1;
  return 0;
}
