#include<bits/stdc++.h>
using namespace std;
int p[50];
int main(){
int n, m;
cin >> n >> m;
for(int i = 1; i <= n; i++){
int y = m;
cout << y << "\n";
fflush(stdout);
int x;
cin >> x;
if(x == 0)
exit(0);
if(x == -1)
p[i]++;
}
int lo = 0, hi = m + 1, mid, i = 0;
while(hi - lo > 1){
i++;
mid = hi + lo >> 1;
int y = mid;
cout << y << "\n";
fflush(stdout);
int x;
cin >> x;
if(x == 0)
exit(0);
if(!p[i])
x = -x;
if(x == -1)
hi = mid;
else
lo = mid;
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBwWzUwXTsKaW50IG1haW4oKXsKCWludCBuLCBtOwoJY2luID4+IG4gPj4gbTsKCWZvcihpbnQgaSA9IDE7IGkgPD0gbjsgaSsrKXsKCQlpbnQgeSA9IG07CgkJY291dCA8PCB5IDw8ICJcbiI7CgkJZmZsdXNoKHN0ZG91dCk7CgkJaW50IHg7CgkJY2luID4+IHg7CgkJaWYoeCA9PSAwKQoJCQlleGl0KDApOwoJCWlmKHggPT0gLTEpCgkJCXBbaV0rKzsKCX0KCWludCBsbyA9IDAsIGhpID0gbSArIDEsIG1pZCwgaSA9IDA7Cgl3aGlsZShoaSAtIGxvID4gMSl7CgkJaSsrOwoJCW1pZCA9IGhpICsgbG8gPj4gMTsKCQlpbnQgeSA9IG1pZDsKCQljb3V0IDw8IHkgPDwgIlxuIjsKCQlmZmx1c2goc3Rkb3V0KTsKCQlpbnQgeDsKCQljaW4gPj4geDsKCQlpZih4ID09IDApCgkJCWV4aXQoMCk7CgkJaWYoIXBbaV0pCgkJCXggPSAteDsKCQlpZih4ID09IC0xKQoJCQloaSA9IG1pZDsKCQllbHNlCgkJCWxvID0gbWlkOwoJfQoKfQ==