#include <bits/stdc++.h>
#include <fstream>

using namespace std;
#define intMax 2147483647
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repp(i, a, b) for (int i = a; i >= b; i--)
#define be(a) (a.begin(), a.end())
#define rbe(p) (p.rbegin(), p.rend())
#define pb push_back

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n, m, k;
    cin >> n >> m >> k;
    int sum = 0;
    rep(i, 1, n)
    {
        int a;
        cin >> a;
        sum += a;
    }
    int r = k * n;
    if ( r - sum <= m ){
        cout << max(r - sum,0);
    }
    else{
        cout << -1;
    }
}
#include <bits/stdc++.h>
using namespace std;

string revAB(string str) {
    for(int i=0;i<str.size();++i) str[i]=(str[i]=='A'?'B':'A');
    return str;
}

int main() {
    int N,M; cin >> N; M = (1<<N);
    vector<vector<string>> S(N+1);
    S[1] = {"AB"};
    for(int i=2;i<=N;++i) {
        int L = (1<<i);
        S[i].push_back(string(L/2,'A')+string(L/2,'B'));
        for(int j=0;j<S[i-1].size(); ++j) {
            S[i].push_back(S[i-1][j]+S[i-1][j]);
        }
        for(int j=0;j<S[i-1].size(); ++j) {
            S[i].push_back(S[i-1][j]+revAB(S[i-1][j]));
        }
    }
    cout << S[N].size() << "\n";
    for(auto& s:S[N]) {
        cout << s << "\n";
    }
    return 0;
}