#include <bits/stdc++.h>
using namespace std;
bool prime[100000000];
long long gcd(long long a, long long b) {
  while (b > 0) {
    a = a % b;
    a = a ^ b;
    b = b ^ a;
    a = a ^ b;
  }
  return a;
}
long long lcm(long long a, long long b) {
  long long x = (a * b) / gcd(a, b);
  return x;
}
long long ip[100005], sum[100005];
int p1[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
void sieve(void);
int a[1000];
void rec(int n) {
  a[1] = 2;
  for (int i = 2; i <= n; i++) {
    a[i] = a[i - 1] + 3;
  }
}
int main() {
  long long n;
  while (cin >> n) {
    long long a[n + 10], g[n + 10];
    a[0] = 0;
    g[0] = 0;
    int ca = 0, cp = 0;
    for (int i = 1; i <= n; i++) {
      cin >> a[i] >> g[i];
    }
    for (int i = 1; i <= n; i++) {
      if ((abs((ca + a[i]) > cp + 500))) {
        cout << "G";
        cp += g[i];
      } else {
        cout << "A";
        ca += a[i];
      }
    }
    cout << endl;
  }
  return 0;
}
