#include <bits/stdc++.h>
using namespace std;
int cur = -1, m, n;
int cyc[33];
int query(int val) {
  int ret;
  cur = (cur + 1) % n;
  printf("%d\n", val);
  fflush(stdout);
  scanf("%d", &ret);
  return ret;
}
int main() {
  scanf("%d %d", &m, &n);
  for (int i = 0; i < n; i++) {
    int res = query(m);
    if (res == 0) return 0;
    cyc[cur] = -res;
  }
  int bas = 1, son = m;
  while (bas <= son) {
    int res = query(((bas + son) >> 1));
    res *= cyc[cur];
    if (res == 0) return 0;
    if (res == -1)
      son = ((bas + son) >> 1) - 1;
    else
      bas = ((bas + son) >> 1) + 1;
  }
  assert(0);
}
