#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5, MAX = 2e5 + 5;
const long long MOD = 1e9 + 7, mod = 1e9 + 7;
long long dp[N] = {-1};
long long a[N], n;
long long solv(long long i) {
  if (dp[i] != -1) return dp[i];
  long long &ans = dp[i];
  ans = 0;
  for (long long j = i % a[i]; j < n; j += a[i]) {
    if (a[j] > a[i]) ans = ans | !(solv(j));
  }
  return ans;
}
void solve() {
  long long i, j, k, m, ans = MOD;
  cin >> n;
  for (i = 0; i < n + 3; i++) dp[i] = -1;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) cout << (solv(i) ? "A" : "B");
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long T = 1;
  while (T--) solve();
  return 0;
}
