#include <bits/stdc++.h>
using namespace std;
int n, m, p[50];
int ask(int second) {
  cout << second << '\n';
  fflush(stdout);
  cin >> second;
  return second;
}
int main() {
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    p[i] = ask(1);
    if (p[i] == 0) {
      cout << 1 << '\n';
      exit(0);
    }
  }
  int l = 1, r = m, t = 0;
  while (l <= r) {
    int m = (l + r) / 2;
    int tmp = ask(m) * p[t];
    if (tmp == 0) {
      cout << tmp << '\n';
      exit(0);
    }
    if (tmp == -1)
      r = m - 1;
    else
      l = m + 1;
    t = (t + 1) % n;
  }
}
