#include "combo.h"
#include<bits/stdc++.h>
using namespace std;
string pos = "ABXY";
string guess_sequence(int N){
string S = "";
if(press("AB") > 0){
if(press("A") == 1){
S += 'A';
}
else{
S += 'B';
}
}
else{
if(press("X") == 1){
S += 'X';
}
else{
S += 'Y';
}
}
if(N == 1){
return S;
}
string other = "";
for(int i = 0; i < 4; i++){
if(pos[i] != S[0]){
other += pos[i];
}
}
for(int j = 1; j < N - 1; j++){
char a = other[0];
char b = other[1];
char c = other[2];
string s2 = "";
s2 += S;
s2 += a;
s2 += S;
s2 += b;
s2 += a;
s2 += S;
s2 += b;
s2 += b;
s2 += S;
s2 += b;
s2 += c;
int val = press(s2);
if(val == (int)S.size()){
S += c;
}
else{
if(val == (int)S.size() + 1){
S += a;
}
else{
S += b;
}
}
}
for(int i = 0; i < 2; i++){
string s2 = "";
s2 += S;
s2 += other[i];
if(press(s2) == N){
S += other[i];
return S;
}
}
S += other[2];
return S;
}