#include <iostream>
#include <tr1/unordered_set>
#include <tr1/unordered_map>

using namespace std;

const int MAX_N = 100100;

int n;

typedef unsigned int iint;

tr1::unordered_set<iint> viz;

int bits;

iint snd(const iint x)
{
    iint ret = 0;
    for(iint i = 1 ; i <= bits ; ++i) {
        bool good = bool(x & (1 << i)) == bool(x & (1 << (i - 1)));
        ret |= good << i;
    }
    return ret;
}

iint fst(iint x)
{
    x ^= 1LL << bits;
    return x;
}

bool DFS(const iint x, const int depth) {

    if(depth > n)
        return 0;

    if(depth == n)
        return x == 0;

    if(viz.count(x))
        return 0;

    viz.insert(x);

    bool ret = 0;

    if(DFS(fst(x), depth + 1)) {
        ret = 1;
    }
    if(!ret && DFS(snd(x), depth + 1)) {
        ret = 1;
    }

    viz.erase(x);
    return ret;
}

char t[2] = {'A', 'B'};

void bitwise()
{
    for(int i = 0 ; i <= bits ; ++i)
        cout << "A";
}

int steps[MAX_N];

int main()
{
    int sol = 0;

    cin >> n;

    for(bits = 1 ; bits < 31  ; ++bits)
        if(DFS(0, 0))
            break;

    cerr << bits+1 << "\n";

    bitwise();
    cout << "\n";

    long long i;

    for(i = 1; i < n ; i *= 2);

    i /= 2;

    int p = n - i;

    int rem = n;

    for(int i = 1 ; i <= p ; ++i){
        cout << "12";
        rem -= 2;
    }

    for(int i = 1 ; i <= rem ; ++i)
        cout << "2";
    cout << "\n";

    return 0;
}
