#include using namespace std; int main() { int n, k,x,sureAboutAnswer; cin>>n>>k; string response; while(response != "exit") { cout << "query " << x << "\n"; cout.flush(); cin >> response; if(response == "broke") k--; if(!sureAboutAnswer) { cout << "query " << x << "\n"; cout.flush(); cin >> response; if(response == "broke") k--; } else { cout << "answer " << x << "\n"; cout.flush(); cin >> response; } } return 0; }