#include <bits/stdc++.h>
using namespace std;
long long int a[100007], dp[100007];
vector<pair<long long int, long long int> > vs;
bool cmp(pair<long long int, long long int> a,
         pair<long long int, long long int> b) {
  return a.first > b.first;
}
long long int check(long long int idx, long long int n) {
  if (idx >= 1 && idx <= n) return 1;
  return 0;
}
unordered_map<long long int, long long int> mx;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m, u, q, v, i, j, x, y, ans;
  memset(dp, -1, sizeof(dp));
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> u;
    a[i] = u;
    vs.push_back({u, i});
  }
  sort(vs.begin(), vs.end(), cmp);
  for (i = 0; i < vs.size(); i++) {
    u = vs[i].first;
    long long int idx = vs[i].second;
    ans = -1;
    for (j = 1;; j++) {
      long long int pos = idx + j * u;
      if (!check(pos, n)) break;
      if (a[pos] > u && dp[pos] != -1) {
        if (dp[pos] == 1) ans = 2;
      }
    }
    for (j = 1;; j++) {
      long long int pos = idx - j * u;
      if (!check(pos, n)) break;
      if (a[pos] > u && dp[pos] != -1) {
        if (dp[pos] == 1) ans = 2;
      }
    }
    if (ans == -1) ans = 1;
    dp[idx] = ans;
  }
  for (i = 1; i <= n; i++)
    if (dp[i] == 1)
      cout << "B";
    else
      cout << "A";
  return 0;
}
