#include <bits/stdc++.h>
using namespace std;
bool ask(int x) {
  printf("%d\n", x);
  fflush(stdout);
  int y;
  scanf("%d", &y);
  if (y == 0)
    exit(0);
  else
    return y > 0;
}
int main(void) {
  int m, n;
  bool op[32];
  scanf("%d%d", &m, &n);
  for (int i = 0; i < n; i++) op[i] = ask(1);
  int step = 0;
  int low = 1, high = m;
  while (low < high) {
    int mid = (low + high) >> 1;
    if (ask(mid) ^ op[step % n])
      high = mid;
    else
      low = mid + 1;
    step++;
  }
  ask(low);
  return 0;
}
