#include <bits/stdc++.h>
using namespace std;
const int N = 200100;
int dp[N], a[N], n;
vector<int> g[N];
int solve(int idx) {
  int &ret = dp[idx];
  if (~ret) return ret;
  ret = 0;
  for (int i : g[idx]) ret |= !solve(i);
  return ret;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  for (int i = 0; i < n; ++i) {
    for (int j = i - a[i]; j >= 0; j -= a[i])
      if (a[j] > a[i]) g[i].push_back(j);
    for (int j = i + a[i]; j < n; j += a[i])
      if (a[j] > a[i]) g[i].push_back(j);
  }
  memset(dp, -1, sizeof dp);
  for (int i = 0; i < n; ++i) printf(solve(i) ? "A" : "B");
}
