#include <bits/stdc++.h>
using namespace std;
using ull = uint64_t;
using ll = int64_t;
using ld = long double;
const int MAXN = 100228;
int f[MAXN];
vector<int> b[MAXN];
int last[MAXN];
bool res[MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout.setf(ios::fixed);
  cout.precision(20);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    b[x].push_back(i);
    f[i] = 2;
  }
  for (int i = n; i >= 1; --i) {
    for (int x : b[i]) {
      int d = x % i;
      if (last[d] != i) {
        last[d] = i;
        res[d] = false;
        for (int j = d; j < n; j += i) {
          res[d] |= f[j] == 0;
        }
      }
      f[x] = res[d];
    }
  }
  for (int i = 0; i < n; ++i) {
    cout << char('B' - f[i]);
  }
}
