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

// DP

const int N = 1005;
const int K = 20;

int n,k,moves[N][K],step[N][K],sure=0;

int solve(int n,int k)
{
    if ( k == 1 )
    {
        moves[n][k] = n;
        step[n][k] = 1;
        return 1;
    }
    if ( moves[n][k] )
        return step[n][k];
    moves[n][k] = n;
    step[n][k] = 1;
    for (int cuts=1;cuts<n;++cuts)
    {
        int lp = n/(cuts+1) + n%(cuts+1);
        solve(lp,k-1);
        if ( moves[n][k] > moves[lp][k-1] + cuts )
        {
            moves[n][k] = moves[lp][k-1] + cuts;
            step[n][k] = lp;
        }
    }
    return step[n][k];
}

int coo;
map<int,int> mp;

int ask(int v)
{
    string ans;

    if ( v > n ) return 0;

    if ( mp.find(v) != mp.end() )
    {
        return mp[v];
    }

    cout << "query " << v << "\n";
    cout.flush();
    ++coo;

    cin>>ans;

    mp[v] = int(ans!="broke");

    return int(ans!="broke");
}

int main()
{
    cin>>n>>k;
    string ans = "";
    int l = 1 , r = n;
    while ( l != r )
    {
        if ( k == 1 )
        {
            while ( ask(l) )
            {
                ++l;
                if ( l == n+1 ) break;
            }
            r = l;
            l--;
            break;
        }
        int stp = solve(r-l+1,k);
        if ( ask(l + stp) )
            l = l+stp;
        else
        {
            r = l+stp-1;
            --k;
        }
    }
    cout<<"answer "<<(l+1)<<'\n';
    cout.flush();
	cin>>ans;
	cerr<<coo<<'\n';
}