#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char ch[n];
  ch[n] = '\0';
  int a[n][2];
  for (int i = 0; i < n; i++) {
    cin >> a[i][0] >> a[i][1];
  }
  int suma = 0;
  int sumg = 0;
  for (int i = 0; i < n; i++) {
    if (((a[i][0] + suma) - sumg) <= 500) {
      suma += a[i][0];
      ch[i] = 'A';
    } else if (((a[i][1] + sumg) - suma) <= 500) {
      sumg += a[i][1];
      ch[i] = 'G';
    }
  }
  if ((abs(suma - sumg)) > 500) {
    cout << "-1";
  } else {
    cout << ch;
  }
}
