#include <bits/stdc++.h>
int read() {
  int x = 0;
  char c = getchar();
  bool f = 0;
  while (c < '0' || c > '9') (c == '-') ? f = 1, c = getchar() : c = getchar();
  while (c >= '0' && c <= '9')
    x = (x << 1) + (x << 3) + (48 ^ c), c = getchar();
  return (f) ? -x : x;
}
inline int Ask(const int &x) {
  printf("%d\n", x);
  fflush(stdout);
  return read();
}
bool Lies[30];
int main() {
  int m = read(), n = read();
  for (int i = 0; i < n; ++i) {
    int t = Ask(1);
    if (t == 0) return 0;
    Lies[i] = (t == -1);
  }
  int l = 1, r = m, Time = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    int t = Ask(mid);
    if (Lies[Time]) t = -t;
    if (t == 0)
      break;
    else if (t == -1)
      r = mid - 1;
    else
      l = mid + 1;
    Time = (Time + 1) % n;
  }
}
