#include <bits/stdc++.h>
using namespace std;
int min2(int a, int b) {
  if (a > b)
    return b;
  else
    return a;
}
int mod(int a) {
  if (a < 0)
    return -1 * a;
  else
    return a;
}
int main() {
  int n, flag = -1;
  scanf("%d", &n);
  int ans[1000005];
  int i, a, b, sum1 = 0, sum2 = 0;
  for (i = 0; i < n; i++) {
    scanf("%d %d", &a, &b);
    if (mod(sum1 + a - sum2) <= 500) {
      sum1 += a;
      ans[i] = 0;
    } else if (mod(sum2 + b - sum1) <= 500) {
      sum2 += b;
      ans[i] = 1;
    } else {
      flag = 1;
      printf("-1\n");
      break;
    }
  }
  if (flag == -1) {
    for (i = 0; i < n; i++) {
      if (ans[i] == 1)
        printf("G");
      else
        printf("A");
    }
    printf("\n");
  }
  return 0;
}
