#include <bits/stdc++.h>
using namespace std;
int num;
int first[1000010], second[1000010];
int res1 = 0, res2 = 0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> num;
  string res = "";
  for (int i = 0; i < num; i++) {
    cin >> first[i] >> second[i];
  }
  int i = 0;
  while (i != num) {
    if (abs((res1 + first[i]) - res2) <= 500) {
      res1 += first[i];
      res += "A";
    } else if (abs((res2 + second[i]) - res1) <= 500) {
      res2 += second[i];
      res += "G";
    } else {
      cout << -1 << endl;
      return 0;
    }
    i++;
  }
  cout << res << endl;
  return 0;
}
