#include <bits/stdc++.h>
using namespace std;
long long int XpowerY(long long int x, long long int y, long long int m) {
  long long int ans = 1;
  x = x % m;
  while (y > 0) {
    if (y % 2 == 1) ans = (ans * x) % m;
    x = ((x % m) * (x % m)) % m;
    y = y >> 1;
  }
  return ans % m;
}
int arr[112345], dp[112345], rev[112345];
int fun(int v, int n) {
  if (dp[v] != -1) return dp[v];
  int fac = 1, s = 0, fl = 0;
  while (1) {
    if ((v + arr[v] * fac > n) && (v - arr[v] * fac <= 0)) break;
    if ((v + arr[v] * fac <= n) && (arr[v + arr[v] * fac] > arr[v])) {
      s |= fun(v + arr[v] * fac, n);
    }
    if ((v - arr[v] * fac > 0) && (arr[v - arr[v] * fac] > arr[v])) {
      s |= fun(v - arr[v] * fac, n);
    }
    fac++;
  }
  if (!s)
    ;
  dp[v] = 1 - s;
  return dp[v];
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    dp[i] = -1;
  }
  for (int i = 1; i <= n; i++) {
    if (fun(i, n)) {
      cout << "B";
    } else {
      cout << "A";
    }
  }
  cout << endl;
  return 0;
}
