#include <cstdio>
#include <string.h>

using namespace std;

int main()
{
    int inc, sf, mij, n, k;
    char response[10]="";

    scanf("%d%d",&n,&k);
    sf=n;
    inc=0;
    while(strcmp(response,"exit"))
    {

        if(sf-inc==1)
        {
            printf("answer %d\n",inc+1);
            fflush(stdout);
            scanf("%s",response);
        }
        else
        {
            mij=(sf+inc)/2;
            printf("query %d \n",mij);
            fflush(stdout);
            scanf("%s",response);
            if(!strcmp(response,"broke"))
                sf=mij;
            if(!strcmp(response,"survived"))
                inc=mij;
        }
    }
}