#include <bits/stdc++.h>
int M, N, t;
int seq[40];
int main() {
  scanf("%d%d", &M, &N);
  printf("1\n");
  fflush(stdout);
  scanf("%d", &t);
  if (t == 0) return 0;
  seq[1] = t;
  for (int i = 2; i <= N; ++i) {
    printf("1\n");
    fflush(stdout);
    scanf("%d", &t);
    seq[i] = t;
  }
  int p = 0;
  int l = 1, r = M, mid;
  while (l <= r) {
    ++p;
    p = (p - 1) % N + 1;
    mid = (l + r) >> 1;
    printf("%d\n", mid);
    fflush(stdout);
    scanf("%d", &t);
    if (t * seq[p] == 0) {
      return 0;
    }
    if (t * seq[p] == 1) {
      l = mid + 1;
    } else
      r = mid - 1;
  }
}
