#include <bits/stdc++.h>
using namespace std;
int n, a[100000] = {0}, r;
bitset<100000> t, dp;
vector<int> G[100000];
void dfs(int v) {
  t[v] = 1;
  for (int u : G[v]) {
    if (t[u] == 0) dfs(u);
    dp[v] = dp[u] & dp[v];
  }
  dp[v] = !dp[v];
  return;
}
void genDAG() {
  for (int i = 0; i < n; i++) {
    for (int j = i; j < n; j += a[i])
      if (a[j] > a[i]) G[i].push_back(j);
    for (int j = i; j >= 0; j -= a[i])
      if (a[j] > a[i]) G[i].push_back(j);
    if (G[i].size() == 0) {
      t[i] = 1;
      dp[i] = 0;
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  t.reset();
  dp.set();
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1) r = i;
  }
  genDAG();
  if (t[r] == 0) dfs(r);
  for (int i = 0; i < n; i++) {
    if (dp[i])
      cout << 'A';
    else
      cout << 'B';
  }
  cout << '\n';
  return 0;
}
