#include <bits/stdc++.h>
using nt = long long;
int main() {
  nt n;
  std::cin >> n;
  nt a, b;
  nt currA = 0, currB = 0;
  std::string pr;
  for (nt i = 0; i < n; ++i) {
    std::cin >> a >> b;
    if (currA + a > currB + 500) {
      currB += b;
      pr += "G";
    } else {
      currA += a;
      pr += "A";
    }
  }
  if (abs(currA - currB) > 500) {
    std::cout << -1;
  }
  std::cout << pr;
  return 0;
}
