#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100100;
int n;
int a[MAXN];
void load() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
}
int dp[MAXN];
int rek(int x) {
  int &ret = dp[x];
  if (ret) return ret;
  for (int i = x + a[x]; i < n; i += a[x]) {
    if (a[i] < a[x]) continue;
    if (rek(i) == 2) return ret = 1;
  }
  for (int i = x - a[x]; i >= 0; i -= a[x]) {
    if (a[i] < a[x]) continue;
    if (rek(i) == 2) return ret = 1;
  }
  return ret = 2;
}
void solve() {
  for (int i = 0; i < n; i++) {
    printf("%c", (rek(i) == 1) ? 'A' : 'B');
  }
  printf("\n");
}
int main() {
  load();
  solve();
  return 0;
}
