#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
char egg[N];
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int ta = 0;
    int tg = 0;
    for (int i = 0; i < n; i++) {
      int a, g;
      scanf("%d%d", &a, &g);
      if (ta + a - tg <= 500) {
        egg[i] = 'A';
        ta += a;
      } else if (tg + g - ta <= 500) {
        egg[i] = 'G';
        tg += g;
      } else if (ta + a - tg > 500) {
        egg[i] = 'G';
        tg += g;
      } else if (tg + g - ta > 500) {
        egg[i] = 'A';
        ta += ta;
      }
    }
    for (int i = 0; i < n; i++) printf("%c", egg[i]);
  }
  printf("\n");
  return 0;
}
