#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;

typedef long long ll;

ll mod_pow(ll x, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}

int popcount(int x) {
    int ret = 0;
    while (x > 0) {
        ret += x % 2;
        x /= 2;
    }
    return ret;
}

int main() {
    ll N;
    cin >> N;
    cout << (1 << N) - 1 << "\n";
    for (int i = 1; i < (1 << N); i++) {
        rep(j, (1 << N)) {
            if (popcount(i & j) % 2) cout << "A";
            else cout << "B";
        }
        cout << "\n";
    }
}
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < (int)(n); i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
using ll = long long;

int main() {
    int N; cin >> N;
    vector<int> A(N, 0);
    REP(i, 0, N) {
        int a; cin >> a;
        A[--a] = 1;
    }

    if (accumulate(ALL(A), 0) == N) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}
