#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const long long int INF = 9e18 + 2e17;
const int inf = 2e9;
const int N = 1e3 + 22;
const double eps = 1e-10;
const double PI = 3.14159265;
void solve() {
  int n, x, y;
  cin >> n;
  long long int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    if (sum + x <= 500) {
      sum += x;
      cout << 'A';
    } else {
      sum -= y;
      cout << 'G';
    }
  }
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
