#include <bits/stdc++.h>
using namespace std;
int N[10001] = {0};
int main() {
  vector<char> ans;
  int n, a, g;
  cin >> n;
  long long int totalA = 0, totalB = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a >> g;
    if (abs(totalA + a - totalB) <= 500) {
      ans.push_back('A');
      totalA += a;
    } else if (abs(totalB + g - totalA) <= 500) {
      ans.push_back('G');
      totalB += g;
    } else {
      if (totalA < totalB) {
        totalA += a;
        ans.push_back('A');
      } else {
        totalB += g;
        ans.push_back('G');
      }
    }
  }
  if (abs(totalA - totalB) > 500)
    cout << "-1" << endl;
  else {
    for (int i = 0; i < ans.size(); ++i) {
      char temp = ans[i];
      printf("%c", temp);
    }
    cout << endl;
  }
  return 0;
}
