#include <bits/stdc++.h>
using namespace std;
int n, a[100005];
int F[100005];
void readf() {
  cin >> n;
  for (int i = (1); i <= (n); ++i) cin >> a[i];
}
bool f(int i) {
  int &rs = F[i];
  if (rs != -1) return rs;
  rs = 0;
  for (int j = i + a[i]; j <= n; j += a[i])
    if (a[j] > a[i]) rs |= (!f(j));
  for (int j = i - a[i]; j > 0; j -= a[i])
    if (a[j] > a[i]) rs |= (!f(j));
  return rs;
}
void solve() {
  memset(F, -1, sizeof(F));
  for (int i = (1); i <= (n); ++i)
    if (f(i))
      cout << 'A';
    else
      cout << 'B';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  readf();
  solve();
}
