#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main(){
	int n, k, x, up, down;
	string response = "";
	//freopen("input.txt", "r", stdin);
	cin >> n >> k;
	up = n;
	down = 0;
	while(response != "exit"){
		x = (up + down) / 2;
		cout << "query " << x << "\n";
		cout.flush();

		cin >> response;
		if(response == "broke"){
			k --;
			up = x;
		}
		if(response == "survived")
			down = x + 1;

		if(up <= down){
			cout << "answer " << up << '\n';
			cout.flush();
		}

		cin >> response;
	}
	return 0;
}