#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int N = 1e5 + 10;
int n, m;
int a[N];
int state[N];
bool go(int i) {
  if (i + a[i] >= n && i - a[i] < 0) return state[i] = 0;
  if (state[i] != -1) return state[i];
  int j = (i % a[i]), res = 0;
  for (; j < n; j += a[i]) {
    if (a[j] > a[i]) {
      res = max(res, (int)!go(j));
    }
  }
  return state[i] = res;
}
void solve(bool q) {
  memset(state, -1, sizeof(state));
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 0; i < n; i++) {
    go(i);
  }
  string ans = "BA";
  for (int i = 0; i < n; i++) {
    printf("%c", ans[state[i]]);
  }
  puts("");
}
int main() {
  int t = 1, c = 0;
  while (t--) {
    c++;
    solve(c == 7902);
  }
}
