#include <bits/stdc++.h>
using namespace std;
int ask(int y) {
  printf("%d\n", y);
  fflush(stdout);
  int resp;
  scanf("%d", &resp);
  if (resp != 1 and resp != -1) exit(0);
  return resp;
}
int p[35];
int main() {
  int m, n;
  scanf("%d %d", &m, &n);
  for (int i = 0; i < n; i++) {
    int resp = ask(1);
    if (resp == -1)
      p[i] = 1;
    else
      p[i] = -1;
  }
  int lo = 1, hi = m;
  int r = 0;
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    if (ask(mid) * p[r] == -1)
      lo = mid + 1;
    else
      hi = mid - 1;
    r = (r + 1) % n;
  }
  ask(lo);
  return 0;
}
