#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, suma = 0, sumg = 0, a, g;
  int cot = 0;
  char s[1000005];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &a, &g);
    if (suma + a > sumg + 500) {
      sumg += g;
      s[cot++] = 'G';
    } else {
      suma += a;
      s[cot++] = 'A';
    }
  }
  for (int i = 0; i < cot; i++) printf("%c", s[i]);
  printf("\n");
  return 0;
}
