#include <bits/stdc++.h>
const int maxn = 2e5 + 10;
const int mod = 998244353;
using namespace std;
template <typename T1, typename T2>
void ckmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
void ckmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
template <typename T1, typename T2>
void addmo(T1 &a, T2 b) {
  a += b;
  if (a >= mod) a -= mod;
}
int n, a[100010], sg[100010];
int dfs(int x) {
  if (~sg[x]) return sg[x];
  int vis[33000] = {0};
  for (int i = x - a[x]; i >= 1; i -= a[x])
    if (a[i] > a[x]) vis[dfs(i)] = 1;
  for (int i = x + a[x]; i <= n; i += a[x])
    if (a[i] > a[x]) vis[dfs(i)] = 1;
  for (int i = 0;; i++)
    if (!vis[i]) return sg[x] = i;
}
void solve() {
  memset(sg, -1, sizeof(sg));
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    printf("%s", dfs(i) ? "A" : "B");
  }
}
signed main() {
  solve();
  return 0;
}
