#include <bits/stdc++.h>
using namespace std;
int n, ar[100055], dp[100055][2];
int solve(int i, bool player) {
  int &ret = dp[i][player];
  if (~ret) return ret;
  ret = 0;
  for (int j = i + ar[i]; j <= n; j += ar[i]) {
    if (ar[j] > ar[i]) {
      int tmp = !solve(j, player ^ 1);
      ret = max(ret, tmp);
    }
  }
  for (int j = i - ar[i]; j >= 1; j -= ar[i]) {
    if (ar[j] > ar[i]) {
      int tmp = !solve(j, player ^ 1);
      ret = max(ret, tmp);
    }
  }
  return ret;
}
int main() {
  memset(dp, -1, sizeof dp);
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", ar + i);
  }
  for (int i = 1; i <= n; ++i) {
    solve(i, 0);
  }
  for (int i = 1; i <= n; ++i) {
    printf("%c", dp[i][0] ? 'A' : 'B');
  }
  return 0;
}
