#include <bits/stdc++.h>
using namespace std;
char choices[4] = {'A', 'B', 'X', 'Y'};
int press(string p);
string guess_sequence(int N) {
string S = "";
int now = 1;
int fst = 0;
if (press("AB") > 0) {
if (press("A") > 0) {
S += 'A';
fst = 0;
} else {
S += 'B';
fst = 1;
}
} else {
if (press("X") > 0) {
S += 'X';
fst = 2;
} else {
S += 'Y';
fst = 3;
}
}
while (now != N) {
for (int i = 0; i < 4; i++) {
if (i==fst) continue;
if (press(S+choices[i]) > now) {
now++;
S += choices[i];
continue;
}
}
}
return S;
}