#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int n, x, y, diff = 0;
  scanf("%d", &n);
  for (int j = 0; j < n; ++j) {
    scanf("%d %d", &x, &y);
    if (diff + x <= 500) {
      printf("A");
      diff += x;
    } else {
      printf("G");
      diff -= y;
    }
  }
  printf("\n");
  return 0;
}
