#include <bits/stdc++.h>
using namespace std;
vector<long long> g[100005];
long long DP[100005];
long long n, m, k = 0, a[100005];
void input() {
  cin >> n;
  for (long long i = 1; i <= n; ++i) cin >> a[i];
  return;
}
long long dp(long long x) {
  if (DP[x] > 0) return DP[x];
  if (g[x].size() == 0) return DP[x] = 1;
  for (long long i = 0; i < g[x].size(); ++i) {
    DP[x] = max(DP[x], 3 - dp(g[x][i]));
  }
  return DP[x];
}
void solve() {
  queue<long long> q;
  for (long long i = 1; i <= n; ++i) {
    for (long long j = i - a[i]; j > 0; j -= a[i]) {
      if (a[j] > a[i]) {
        g[i].push_back(j);
      }
    }
    for (long long j = i + a[i]; j <= n; j += a[i]) {
      if (a[j] > a[i]) {
        g[i].push_back(j);
      }
    }
  }
  for (long long i = 1; i <= n; ++i) {
    if (dp(i) == 1)
      cout << 'B';
    else
      cout << 'A';
  }
  return;
}
void output() { return; }
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  {
    input();
    solve();
    output();
  }
  return 0;
}
