#include <bits/stdc++.h>
using namespace std;
int N;
int v[100001];
vector<int> dp(100001, -1);
int f(int n) {
  if (dp[n] != -1) return dp[n];
  int m, ret = 0;
  m = n;
  while (1) {
    m -= v[n];
    if (m < 0) break;
    if (v[m] <= v[n]) continue;
    if (f(m) == 0) ret = 1;
  }
  m = n;
  while (1) {
    m += v[n];
    if (m >= N) break;
    if (v[m] <= v[n]) continue;
    if (f(m) == 0) ret = 1;
  }
  return dp[n] = ret;
}
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) scanf("%d", &v[i]);
  for (int i = 0; i < N; i++) {
    if (f(i) == 1)
      printf("A");
    else
      printf("B");
  }
  return 0;
}
