#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
int dp[MAX];
int a[MAX];
int n;
bool solve(int idx) {
  if (dp[idx] != -1) return dp[idx];
  for (int i = idx + a[idx]; i < n; i += a[idx])
    if (a[i] > a[idx] && !solve(i)) return dp[idx] = 1;
  for (int i = idx - a[idx]; i >= 0; i -= a[idx])
    if (a[i] > a[idx] && !solve(i)) return dp[idx] = 1;
  return dp[idx] = 0;
}
int main() {
  memset(dp, -1, sizeof(dp));
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) ((solve(i) && cout << 'A') || cout << 'B');
  return 0;
}
