#include <iostream>

#include <fstream>

#include <vector>

using namespace std;

vector<char> x;

vector<char>::iterator it;

ifstream fi("taoxau.inp");

ofstream fo("taoxau.out");long int k;

void write_out() {

for( it = x.begin()+1; it < x.end(); it++ ) fo<< *it ;

fo << endl; dem++;

}

void ChinhHopLap(long int i) {

for (char j='A'; j<='B'; j++) {

if (!(x[i-1]=='B' && j=='Bd')) {

x[i]=j;

if (i==k) write_out();

else ChinhHopLap(i+1);

}

}

}

int main() {

fi >> k ;

x.resize(k+1, '0');

x[0]='0';

ChinhHopLap(1);

return 0;

}