#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int n;
  scanf("%lld", &n);
  vector<long long int> v(n);
  vector<pair<long long int, long long int> > v1;
  for (long long int i = 0; i < n; ++i) {
    scanf("%lld", &v[i]);
    v1.push_back(make_pair(v[i], i));
  }
  sort(v1.begin(), v1.end(), greater<pair<long long int, long long int> >());
  vector<long long int> ans(n);
  for (long long int i = 0; i < n; ++i) {
    ans[i] = -1;
  }
  vector<long long int> s;
  for (long long int i = 0; i < n; ++i) {
    if (i == 0) {
      ans[v1[i].second] = 0;
      s.push_back(v1[i].second);
    } else {
      long long int c = 0;
      for (long long int k = v1[i].second + v1[i].first; k < n;
           k += v1[i].first) {
        if (ans[k] == 0) {
          ans[v1[i].second] = 1;
          c = 1;
          break;
        }
      }
      if (c == 0) {
        for (long long int k = v1[i].second - v1[i].first; k >= 0;
             k -= v1[i].first) {
          if (ans[k] == 0) {
            ans[v1[i].second] = 1;
            c = 1;
            break;
          }
        }
      }
      if (c == 0) {
        ans[v1[i].second] = 0;
      }
    }
  }
  for (long long int i = 0; i < ans.size(); ++i) {
    if (ans[i] == 1) {
      printf("A");
    } else {
      printf("B");
    }
  }
  return 0;
}
