#include <bits/stdc++.h>
using namespace std;
int m, n, x[35], at;
int lo, hi, mi;
int ta;
int main() {
  scanf("%d%d", &m, &n);
  for (int i = 0; i < n; i++) {
    printf("1\n");
    fflush(stdout);
    scanf("%d", x + i);
    if (x[i] == 0 || x[i] == -2) return 0;
  }
  lo = 1;
  hi = m + 1;
  while (lo < hi) {
    mi = (lo + hi) / 2;
    printf("%d\n", mi);
    fflush(stdout);
    scanf("%d", &ta);
    if (x[at] == -1) ta = -ta;
    at = (at + 1) % n;
    if (ta == 0 || ta == -2 || ta == 2) return 0;
    if (ta == -1)
      hi = mi;
    else
      lo = mi + 1;
  }
  printf("%d\n", lo);
  fflush(stdout);
  return 0;
}
