#include <bits/stdc++.h>
using namespace std;
const int maxn = 61;
long long p[maxn], m, n;
int ask(int y) {
  cout << y << endl;
  long long x;
  cin >> x;
  return x;
}
int main() {
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    long long h = ask(1);
    if (h == 0) {
      return 0;
    } else if (h == -1) {
      p[i] = 0;
    } else {
      p[i] = 1;
    }
  }
  long long lo = 0, hi = m + 1;
  long long cnt = 0;
  while (hi - lo > 1) {
    long long mid = ((lo + hi) >> 1);
    long long h = ask(mid);
    if (h == 0) {
      return 0;
    }
    if (p[cnt % n] == 0) {
      h *= -1;
      ;
    }
    if (h == 1) {
      lo = mid;
    } else if (h == -1) {
      hi = mid;
    }
    cnt++;
  }
  return 0;
}
