#include <bits/stdc++.h>
using namespace std;
int db[100005][2];
vector<vector<int> > v(100002);
int dfs(int i, int cur) {
  if (db[i][cur] != -1) return db[i][cur];
  int x = !cur;
  for (int h = 0; h < v[i].size(); h++) {
    if (dfs(v[i][h], !cur) == cur) {
      x = cur;
    }
  }
  return db[i][cur] = x;
}
int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  int n, x;
  cin >> n;
  vector<int> ce(n);
  for (int i = 0; i < n; i++) {
    cin >> ce[i];
  }
  for (int i = 0; i < n; i++) {
    for (int h = i + ce[i]; h < n; h += ce[i]) {
      if (ce[h] > ce[i]) v[ce[i]].push_back(ce[h]);
    }
    for (int h = i - ce[i]; h >= 0; h -= ce[i]) {
      if (ce[h] > ce[i]) v[ce[i]].push_back(ce[h]);
    }
  }
  memset(db, -1, sizeof db);
  for (int i = 1; i <= n; i++) {
    dfs(i, 0);
  }
  string s = "";
  for (int i = 0; i < ce.size(); i++) {
    if (db[ce[i]][0] == 0) {
      s += "A";
    } else
      s += "B";
  }
  cout << s << endl;
  return 0;
}
