#include <bits/stdc++.h>
int main() {
  long int n;
  scanf("%ld", &n);
  char str[n + 1];
  memset(str, '\0', n + 1);
  int d, d1, ma = 0, mb = 0, ma1 = 0, mb1 = 0, ma2 = 0, mb2 = 0, i = 0, fl = 0;
  while (n > 0) {
    int a, g;
    scanf("%d%d", &a, &g);
    ma1 = a + ma;
    mb1 = mb;
    d = abs(ma1 - mb1);
    mb2 = g + mb;
    ma2 = ma;
    d1 = abs(ma2 - mb2);
    if (d <= 500) {
      ma = ma1;
      str[i] = 'A';
      i++;
    } else if (d1 <= 500) {
      mb = mb2;
      str[i] = 'G';
      i++;
    } else {
      fl = 1;
    }
    n--;
  }
  if (fl == 1)
    printf("-1");
  else {
    for (i = 0; str[i] != '\0'; i++) printf("%c", str[i]);
  }
  return 0;
}
