#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T& x) {
  int w = 1;
  T data = 0;
  char c = getchar();
  while (c != '-' && !isdigit(c)) c = getchar();
  if (c == '-') w = -1, c = getchar();
  while (isdigit(c)) data = 10 * data + c - '0', c = getchar();
  x = data * (T)w;
}
int m, n, p[33], op;
int main() {
  read(m), read(n);
  for (int i = 0; i < n; ++i) {
    puts("1");
    fflush(stdout);
    read(op);
    if (op == 0) return 0;
    p[i] = (op == -1);
  }
  int lb = 2, rb = m + 1, t = 0;
  while (lb + 1 < rb) {
    int mid = lb + ((rb - lb) >> 1);
    printf("%d\n", mid);
    fflush(stdout);
    read(op);
    if (op == 0) return 0;
    if (p[t]) op = -op;
    if (op == 1)
      lb = mid + 1;
    else
      rb = mid;
    t = (t + 1) % n;
  }
  printf("%d\n", lb);
  fflush(stdout);
  read(op);
  return 0;
}
