#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    sum += x;
    cin >> x;
  }
  for (int k = 0; k <= n; k++) {
    int total = abs(sum - k * 1000);
    if (total <= 500) {
      for (int i = 0; i < k; i++) cout << "G";
      for (int i = 0; i < n - k; i++) cout << "A";
      cout << "\n";
      return 0;
    }
  }
  cout << "-1\n";
}
