#include <bits/stdc++.h>
using namespace std;
vector<vector<pair<int, int> > > graph =
    vector<vector<pair<int, int> > >(5000 + 1);
vector<int> visited = vector<int>(1 + 1, 0), parent = vector<int>(1 + 1);
vector<int> dist = vector<int>(1 + 1);
void Dijkstra(int source, int n) {
  for (int i = 1; i <= n; i++) dist[i] = INT_MAX;
  dist[source] = 0;
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 std::greater<pair<int, int> > >
      p;
  p.push(make_pair(0, source));
  parent[source] = -1;
  while (p.empty() == false) {
    pair<int, int> current = p.top();
    p.pop();
    int cv = current.second;
    int cw = current.first;
    if (visited[cv] == 1) continue;
    visited[cv] = 1;
    for (vector<pair<int, int> >::iterator itr = graph[cv].begin();
         itr != graph[cv].end(); itr++) {
      if (visited[itr->second] == 0 && dist[itr->second] > cw + itr->first) {
        parent[itr->second] = cv;
        dist[itr->second] = cw + itr->first;
        p.push(make_pair(dist[itr->second], itr->second));
      }
    }
  }
}
void printPath(int j) {
  if (parent[j] == -1) {
    cout << j << " ";
    return;
  }
  printPath(parent[j]);
  printf("%d ", j);
}
signed long long int a[1000003], b[1000003], n;
char arr[1000003];
int calc(int i, signed long long int sa, signed long long int sb) {
  if (i == n && abs(sa - sb) < 501) {
    arr[i] = '\0';
    return 1;
  }
  if (sa - sb > 0) {
    if (((signed long long int)b[i] + sb <= sa + (signed long long int)500) &&
        calc(i + 1, sa, sb + (signed long long int)b[i])) {
      arr[i] = 'G';
      return 1;
    } else if ((sa + (signed long long int)a[i] <=
                sb + (signed long long int)500) &&
               calc(i + 1, sa + (signed long long int)a[i], sb)) {
      arr[i] = 'A';
      return 1;
    } else
      return 0;
  } else if (sb - sa > 0) {
    if (((signed long long int)a[i] + sa <= sb + (signed long long int)500) &&
        calc(i + 1, sa + (signed long long int)a[i], sb)) {
      arr[i] = 'A';
      return 1;
    } else if ((sb + (signed long long int)b[i] <=
                sa + (signed long long int)500) &&
               calc(i + 1, sa, (signed long long int)b[i] + sb)) {
      arr[i] = 'G';
      return 1;
    } else
      return 0;
  } else {
    if (a[i] < 501 && calc(i + 1, sa + a[i], sb)) {
      arr[i] = 'A';
      return 1;
    } else {
      arr[i] = 'G';
      return calc(i + 1, sa, sb + (signed long long int)b[i]);
    }
  }
  return 0;
}
int main() {
  int i = 0;
  scanf("%d", &n);
  for (i; i < n; i++) {
    scanf("%d", &a[i]);
    scanf("%d", &b[i]);
  }
  if (calc(0, 0, 0))
    printf("%s", arr);
  else
    cout << -1;
  return 0;
}
