#include <bits/stdc++.h>
using namespace std;
const int OO = (int)1e6;
const double EPS = (1e-11);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
int main() {
  int n;
  cin >> n;
  int l, r;
  int dif = 0;
  char c[1000010];
  int f = 1;
  for (int i = 0; i < (int)(n); ++i) {
    scanf("%d", &l);
    scanf("%d", &r);
    if (dif + l <= 500) {
      c[i] = 'A';
      dif += l;
    } else {
      if (dif - r <= 500 && dif - r >= -500) {
        c[i] = 'G';
        dif -= r;
      } else {
        f = 0;
        break;
      }
    }
  }
  if (f) {
    for (int i = 0; i < (int)(n); ++i) {
      cout << c[i];
    }
  } else {
    cout << "-1";
  }
  return 0;
}
