#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int M = 1e9 + 7;
const double PI = 3.14159265358;
vector<int> graph[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> nums(n + 1, 0);
  for (int i = 1; i <= n; i++) cin >> nums[i];
  vector<int> ans(n + 1, -1);
  for (int i = 1; i <= n; i++) {
    for (int j = i + nums[i]; j <= n; j += nums[i])
      if (nums[j] > nums[i]) graph[i].push_back(j);
    for (int j = i - nums[i]; j >= 1; j -= nums[i])
      if (nums[j] > nums[i]) graph[i].push_back(j);
    if (graph[i].empty()) ans[i] = 0;
  }
  bool nxt = true;
  while (nxt) {
    nxt = false;
    for (int i = 1; i <= n; i++) {
      if (ans[i] == -1) {
        nxt = true;
        bool check = false;
        for (auto j : graph[i]) {
          if (ans[j] == 0)
            ans[i] = 1;
          else if (ans[j] == -1)
            check = true;
        }
        if (!check && ans[i] != 1) ans[i] = 0;
      }
    }
  }
  for (int i = 1; i <= n; i++) ans[i] ? cout << 'A' : cout << 'B';
  return 0;
}
