#include <bits/stdc++.h>
using namespace std;
const long long int linf = (long long int)9e18;
vector<int> a, b;
int n, suma, sumb;
vector<char> ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    a.push_back(x);
    b.push_back(y);
  }
  for (int i = 0; i < n; i++) {
    if ((a[i] + suma) - sumb <= 500) {
      suma += a[i];
      ans.push_back('A');
    } else {
      sumb += b[i];
      ans.push_back('G');
    }
  }
  for (auto x : ans) cout << x;
  cout << endl;
  return 0;
}
