#include <bits/stdc++.h>
using namespace std;
int n;
int A[200200];
int Dp[200200];
bool Rec(int Start) {
  if (Dp[Start] != -1) return Dp[Start];
  Dp[Start] = false;
  for (int i = Start; i <= n; i += A[Start]) {
    if (A[i] > A[Start]) {
      bool t = !Rec(i);
      Dp[Start] |= t;
      if (Dp[Start]) return Dp[Start] = true;
    }
  }
  if (Dp[Start]) goto End;
  for (int i = Start; i >= 0; i -= A[Start]) {
    if (A[i] > A[Start]) {
      bool t = !Rec(i);
      Dp[Start] |= t;
      if (Dp[Start]) return Dp[Start] = true;
    }
  }
End:
  return Dp[Start];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> A[i];
  for (int i = 1; i <= n + 1; i++) Dp[i] = -1;
  for (int i = 1; i <= n; i++) Rec(i);
  for (int i = 1; i <= n; i++) {
    if (Dp[i])
      cout << "A";
    else
      cout << "B";
  }
  cout << endl;
  return 0;
}
