#include <bits/stdc++.h>
using namespace std;
long long int i, T, N, tc = 0, t = 0;
long long int n;
string s;
bool temp = true;
pair<long long int, long long int> arr[1000010];
bool String(long long int i, long long int ai = 0, long long int gi = 0) {
  if (ai - gi > 500 || gi - ai > 500) {
    return false;
  }
  if (i == n) {
    temp = false;
    return true;
  }
  bool a = false, b = false;
  if (temp && (a = String(i + 1, arr[i].first + ai, gi))) {
    s.push_back('A');
  }
  if (temp && (b = String(i + 1, ai, gi + arr[i].second))) {
    s.push_back('G');
  }
  return a || b;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (long long int i = 0; i < n; i++) cin >> arr[i].first >> arr[i].second;
  if (String(0, 0, 0)) {
    reverse(s.begin(), s.end());
    cout << s;
  } else
    cout << -1;
}
