#include <bits/stdc++.h>
using namespace std;
int cost[1000002][2];
int main() {
  int n, cur_costa = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> cost[i][0] >> cost[i][1];
  }
  cur_costa = cost[0][0];
  int cur_costg = 0;
  char ans[1000002];
  ans[0] = 'A';
  for (int i = 1; i < n; i++) {
    if (abs(cur_costg + cost[i][1] - cur_costa) <
        abs(cur_costa + cost[i][0] - cur_costg)) {
      cur_costg += cost[i][1];
      ans[i] = 'G';
    } else {
      cur_costa += cost[i][0];
      ans[i] = 'A';
    }
  }
  ans[n] = '\0';
  if (abs(cur_costg - cur_costa) <= 500) {
    cout << ans << endl;
  } else {
    cur_costg = cost[0][1];
    cur_costa = 0;
    ans[0] = 'G';
    for (int i = 1; i < n; i++) {
      if (abs(cur_costg + cost[i][1] - cur_costa) <
          abs(cur_costa + cost[i][0] - cur_costg)) {
        cur_costg += cost[i][1];
        ans[i] = 'G';
      } else {
        cur_costa += cost[i][0];
        ans[i] = 'A';
      }
    }
    ans[n] = '\0';
    if (abs(cur_costg - cur_costa) <= 500) {
      cout << ans << endl;
    } else {
      cout << "-1" << endl;
    }
  }
  return 0;
}
