#include <bits/stdc++.h>
using namespace std;
long long arr[100001][2] = {0};
bool ready[100001][2] = {false};
long long dp(long long idx, long long player, vector<long long> &a) {
  if (ready[idx][player])
    return arr[idx][player];
  else {
    long long total = 0;
    long long n = a.size();
    for (long long i = idx + a[idx]; i < n; i += a[idx]) {
      if (a[i] > a[idx]) {
        long long val = dp(i, 1 - player, a);
        if (val == player) {
          arr[idx][player] = player;
          ready[idx][player] = true;
          return player;
        }
      }
    }
    for (long long i = idx - a[idx]; i >= 0; i -= a[idx]) {
      if (a[i] > a[idx]) {
        long long val = dp(i, 1 - player, a);
        if (val == player) {
          arr[idx][player] = player;
          ready[idx][player] = true;
          return player;
        }
      }
    }
  }
  arr[idx][player] = 1 - player;
  ready[idx][player] = true;
  return 1 - player;
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n, 0);
  for (long long i = 0; i < n; i++) cin >> a[i];
  string s = "";
  for (long long i = 0; i < n; i++) {
    long long val = dp(i, 0, a);
    if (val == 0)
      s += 'A';
    else
      s += 'B';
  }
  cout << s << '\n';
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
