#include <bits/stdc++.h>
const int maxn = 35;
int m, n, t, a[maxn];
int query(int x) {
  printf("%d\n", x);
  fflush(stdout);
  scanf("%d", &x);
  if (x == 0) {
    exit(0);
  }
  return x;
}
int main() {
  scanf("%d %d", &m, &n);
  for (int i = 0; i < n; i++) {
    a[i] = query(m);
  }
  int l = 1, r = m, mid;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (query(mid) * a[t++ % n] == -1) {
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  return 0;
}
