#include <bits/stdc++.h>
using namespace std;
int n, ar[100001], dp[100001][2];
bool fun(int idx, int person) {
  if (dp[idx][person] != -1) return dp[idx][person];
  bool canWin = false;
  for (int d = ar[idx] + idx; d < n; d += ar[idx]) {
    if (ar[d] <= ar[idx]) continue;
    bool oponent_can_win = fun(d, 1 - person);
    if (oponent_can_win == false) canWin = true;
  }
  for (int d = idx - ar[idx]; d >= 0; d -= ar[idx]) {
    if (ar[d] <= ar[idx]) continue;
    bool oponent_can_win = fun(d, 1 - person);
    if (oponent_can_win == false) canWin = true;
  }
  return dp[idx][person] = canWin;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
  }
  memset(dp, -1, sizeof dp);
  for (int i = 0; i < n; i++) {
    bool alice = fun(i, 0);
    if (alice)
      cout << 'A';
    else
      cout << 'B';
  }
  return 0;
}
