#include <iostream>
#include <fstream>
using namespace std;
int n, k;

int main()
{
	int st, dr, mij, rez;
	cin>>n>>k; //read the number of stories and eggs
     
	st = 0;
	dr = n;
	rez = 0;
	string response;
	while(response != "exit") {
		mij = (st + dr) / 2;
		cout << "query " << mij << "\n"; //can also use endl for newline
		cout.flush();
     
		cin >> response;
        if(response == "broke")
		{
			k--;
			dr = mij - 1;
		}
		else
		{
			st = mij + 1;
			rez = mij;
		}
		if(k == 0 || st > dr)
		{
			cout << "answer " << (rez + 1) << "\n";
			cout.flush();
			cin >> response;
		}
	}
	return 0;
}