#include <bits/stdc++.h>
using namespace std;
const int mn = 1e5 + 10;
int a[mn], v[mn], n;
bool wins(int idx) {
  if (idx < 0 || idx >= n) return 1;
  if (v[idx] != -1) return v[idx];
  if (v[idx] == n) return 1;
  int dx = a[idx], nx = idx - dx;
  while (nx >= 0) {
    if (a[nx] > dx && !wins(nx)) return v[idx] = 1;
    nx -= dx;
  }
  nx = idx + dx;
  while (nx < n) {
    if (a[nx] > dx && !wins(nx)) return v[idx] = 1;
    nx += dx;
  }
  return v[idx] = 0;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    v[i] = -1;
  }
  for (int i = 0; i < n; i++) {
    if (wins(i))
      printf("A");
    else
      printf("B");
  }
  printf("\n");
  return 0;
}
