#include <iostream>
#include <iomanip>
#include <utility>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstdint>
#include "combo.h"
using namespace std;
/*
int press(string p){
    cout << p << endl;
    int k;
    cin >> k;
    return k;
}*/
string guess_sequence(int n){
    string ans, comb, c1, c2, c3;
    char first;
    if (press("AB") > 0) first = "BA"[press("A")];
    else first = "XY"[press("Y")];
    c1 = "AB"[first < 'B'];
    c2 = "BX"[first < 'X'];
    c3 = "XY"[first < 'Y'];
    ans += first;
    if (n == 1) return ans;
    comb = c1 + c2 + c3;
    for (int i = 1; i < n - 1; i++) ans += comb[press(ans + c2 + ans + c3 + c1 + ans + c3 + c2 + ans + c3 + c3) - i];
    if (press(ans + c1) == n) return ans + c1;
    else if (press(ans + c2) == n) return ans + c2;
    else return ans + c3;
}
/*
int main(){
    cout << guess_sequence(5) << endl;
}
*/
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |