#include <iostream>
#include <string>
using namespace std;

int main()
{
	int n, k;
	bool ok = false;
	 cin >> n >> k; 
	 int x = n / 2;
		 string response;
	 while (response != "exit") {
		     cout << "query " << x << "\n"; 
		    cout.flush();
		
		    cin >> response;
			if (response == "broke" && !k)
			{
				x = x / 2;
				k = false;
			}

			if (response == "survived")
			{
				x  = (n + x) / 2;
				ok = true;
			}
			
			if (response == "broke" && ok)
			{
				cout << "answer " << x << "\n";
				cout.flush();
				cin >> response;
			}
		
	}

	 return 0;
}