#include <bits/stdc++.h>
using namespace std;
int a[100000], win[100000] = {}, n;
int dp(int i) {
  if (win[i] == 0) {
    int f = 2;
    for (int j = i - a[i]; j >= 0; j -= a[i]) {
      if (a[j] > a[i] && dp(j) == 2) {
        f = 1;
        break;
      }
    }
    if (f == 2) {
      for (int j = i + a[i]; j < n; j += a[i]) {
        if (a[j] > a[i] && dp(j) == 2) {
          f = 1;
          break;
        }
      }
    }
    win[i] = f;
  }
  return win[i];
}
int main() {
  scanf("%i", &n);
  for (int i = 0; i < n; i++) {
    scanf("%i", &a[i]);
  }
  for (int i = 0; i < n; i++) {
    if (dp(i) == 1)
      printf("A");
    else
      printf("B");
  }
  return 0;
}
