#include <bits/stdc++.h>
using namespace std;
int n, p[100005], a[100005];
bool dfs(int e) {
  if (p[e] != -1) {
    return p[e];
  }
  for (int i = e + a[e]; i <= n; i += a[e])
    if (a[i] > a[e] && !dfs(i)) return p[e] = 1;
  for (int i = e - a[e]; i >= 1; i -= a[e])
    if (a[i] > a[e] && !dfs(i)) return p[e] = 1;
  return p[e] = 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  memset(p, -1, sizeof(p));
  for (int i = 1; i <= n; i++) {
    if (dfs(i))
      cout << 'A';
    else
      cout << 'B';
  }
  return 0;
}
