#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  cin >> n;
  int sa, sb;
  string str = "";
  sa = sb = 0;
  int flag = 1;
  while (n--) {
    cin >> a >> b;
    if (abs(sa + a - sb) <= 500) {
      sa += a;
      str += "A";
    } else {
      if (abs(sb + b - sa) <= 500) {
        sb += b;
        str += "G";
      } else {
        flag = 0;
      }
    }
  }
  if (flag == 0)
    cout << "-1" << endl;
  else
    cout << str << endl;
}
