#include <bits/stdc++.h>
using namespace std;
const int nn = 100006;
int dp[nn];
int aa[nn];
int n;
int rec(int i) {
  if (dp[i] != -1) return dp[i];
  int cnt = 0;
  int j = i;
  while (j - aa[i] >= 0) {
    if (aa[j - aa[i]] > aa[i]) cnt++;
    j = j - aa[i];
  }
  j = i;
  while (j + aa[i] < n) {
    if (aa[j + aa[i]] > aa[i]) cnt++;
    j = j + aa[i];
  }
  if (cnt == 0) return dp[i] = 0;
  j = i;
  int val = 1;
  while (j - aa[i] >= 0) {
    if (aa[j - aa[i]] > aa[i]) val *= rec(j - aa[i]);
    j = j - aa[i];
  }
  j = i;
  while (j + aa[i] < n) {
    if (aa[j + aa[i]] > aa[i]) val *= rec(j + aa[i]);
    j = j + aa[i];
  }
  if (val == 0) return dp[i] = 1;
  return dp[i] = 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> aa[i];
  memset(dp, -1, sizeof(dp));
  for (int i = 0; i < n; i++) {
    if (dp[i] == -1) rec(i);
  }
  for (int i = 0; i < n; i++) {
    if (dp[i] == 0)
      cout << "B";
    else
      cout << "A";
  }
  return 0;
}
