#include <bits/stdc++.h>
using namespace std;
char arr[1000000];
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int a, b;
  int sum = 0;
  for (auto i = 0; i < n; i++) {
    cin >> a >> b;
    if (sum + a <= 500) {
      arr[i] = 'A';
      sum += a;
    } else {
      arr[i] = 'G';
      sum -= b;
    }
  }
  for (auto i = 0; i < n; i++) {
    cout << arr[i];
  }
  cout << endl;
  return 0;
}
