#include <bits/stdc++.h>
using namespace std;
class Graph {
 public:
  int n;
  vector<vector<int> > adj;
  vector<int> a;
  vector<bool> dp;
  Graph(int n) {
    this->n = n;
    a.resize(n + 1);
    adj.resize(n + 1);
    dp.resize(n + 1, false);
  }
  void add_edge(int u, int v) { adj[u].push_back(v); }
  void create_tree() {
    for (int i = 1; i <= n; i++) {
      for (int m = (1 - i) / a[i]; m <= (n - i) / a[i]; m++) {
        if (a[i + m * a[i]] > a[i]) adj[i].push_back(i + m * a[i]);
      }
    }
  }
  void printGraph() {
    for (size_t i = 0; i < n; i++) {
      cout << i + 1 << " - > ";
      for (int j = 0; j < adj[i + 1].size(); j++) {
        cout << adj[i + 1][j] << " ";
      }
      cout << "\n";
    }
  }
  void dfs(int u, vector<bool>& visited) {
    visited[u] = true;
    dp[u] = true;
    for (auto v : adj[u]) {
      if (!visited[v]) dfs(v, visited);
      dp[u] = dp[u] && (!dp[v]);
    }
  }
  void solve() {
    vector<bool> visited(n + 1, false);
    create_tree();
    for (int i = 1; i <= n; i++) {
      if (!visited[i]) dfs(i, visited);
    }
    for (int i = 1; i <= n; i++) cout << (dp[i] ? "B" : "A");
    cout << "\n";
  }
};
int main() {
  int n;
  cin >> n;
  Graph g(n);
  for (int i = 1; i <= n; i++) cin >> g.a[i];
  g.solve();
}
