#include <bits/stdc++.h>
int n, cycle;
int flag[55];
int query(int num) {
  printf("%d\n", num);
  fflush(stdout);
  int res;
  scanf("%d", &res);
  return res;
}
int main() {
  scanf("%d%d", &n, &cycle);
  for (int i = 0; i < cycle; i++) {
    int res = query(1);
    if (res == 0) return 0;
    if (res == 1)
      flag[i] = true;
    else
      flag[i] = false;
  }
  int l = 1, r = n, turn = 0;
  while (l <= r) {
    int mid = (l + r) / 2;
    int res = query(mid);
    if (res == 0) return 0;
    if (!flag[turn % cycle]) res = -res;
    if (res == 1)
      l = mid + 1;
    else
      r = mid - 1;
    turn++;
  }
  return 0;
}
