#include <bits/stdc++.h>
using namespace std;
long long int n, m, q, x;
vector<long long int> adj[(long long int)1e5 + 1], top;
long long int a[(long long int)1e5 + 1], b[(long long int)1e5 + 1],
    vis[(long long int)1e5 + 1];
void dfs(long long int u) {
  vis[u] = 1;
  for (long long int v : adj[u]) {
    if (!vis[v]) dfs(v);
  }
  top.push_back(u);
}
void t_sort() {
  for (long long int i = 1; i <= n; i++) {
    if (!vis[i]) dfs(i);
  }
}
void solve() {
  long long int i, j, k;
  cin >> n;
  memset(b, 0, sizeof(b));
  memset(vis, 0, sizeof(vis));
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) {
    long long int x = a[i];
    j = i;
    while (j + x <= n) {
      j += x;
      if (a[j] > x) adj[i].push_back(j);
    }
    x = -x;
    j = i;
    while (j + x > 0) {
      j += x;
      if (a[j] > x * -1) adj[i].push_back(j);
    }
  }
  t_sort();
  for (i = 0; i < n; i++) {
    for (long long int u : adj[top[i]]) {
      if (b[u] == 0) {
        b[top[i]] = 1;
        break;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    if (b[i] == 0)
      cout << "B";
    else
      cout << "A";
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long int T = 1;
  while (T--) {
    solve();
    cout << "\n";
  }
}
