#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long t;
  cin >> t;
  long long mini = 0, i = 0;
  char s[t];
  long long j = 0;
  while (t--) {
    long long first, second;
    cin >> first >> second;
    if (i == 0) {
      if (first <= second) {
        mini += first;
        i++;
        s[j++] = 'A';
        continue;
      } else {
        mini = mini - second;
        i++;
        s[j++] = 'G';
        continue;
      }
    }
    if (abs(mini + first) <= 500 && abs(mini - second) <= 500) {
      if (abs(mini + first) <= abs(mini - second) <= 500) {
        mini += first;
        s[j++] = 'A';
        continue;
      } else {
        mini -= second;
        s[j++] = 'G';
        continue;
      }
    } else if (abs(mini + first) <= 500) {
      s[j++] = 'A';
      mini += first;
      continue;
    } else if (abs(mini - second) <= 500) {
      s[j++] = 'G';
      mini -= second;
      continue;
    } else {
      cout << "-1";
      return 0;
    }
  }
  for (long long h = 0; h < j; h++) {
    cout << s[h];
  }
}
