#include <bits/stdc++.h>
using namespace std;
int GLL(long long& x) { return scanf("%lld", &x); }
int GI(int& x) { return scanf("%d", &x); }
const int MAXN = 100005;
int a[MAXN], dp[MAXN];
vector<pair<int, int> > ai;
int n;
int main() {
  GI(n);
  for (int i = 1; i <= (int)(n); i++) {
    GI(a[i]);
    ai.push_back(make_pair(a[i], i));
  }
  memset(dp, -1, sizeof dp);
  sort(ai.rbegin(), ai.rend());
  for (auto p : ai) {
    int i = p.second;
    dp[i] = 0;
    for (int j = i - a[i]; j >= 1; j -= a[i]) {
      if (a[j] > a[i] && dp[j] == 0) {
        dp[i] = 1;
      }
    }
    for (int j = i + a[i]; j <= n; j += a[i]) {
      if (a[j] > a[i] && dp[j] == 0) {
        dp[i] = 1;
      }
    }
  }
  for (int i = 1; i <= (int)(n); i++) {
    if (dp[i])
      printf("A");
    else
      printf("B");
  }
  printf("\n");
  return 0;
}
