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