#include <bits/stdc++.h>
using namespace std;
int main() {
  long long m;
  int n;
  cin >> m >> n;
  int ans = -1;
  vector<int> t(n);
  for (int i = 0; i < n; i++) {
    cout << 1 << endl;
    fflush(stdout);
    cin >> ans;
    if (ans == 1) {
      t[i] = 1;
    } else if (ans == -1) {
      t[i] = -1;
    } else {
      exit(0);
    }
  }
  long long hi = m;
  long long lo = 1;
  long long mid = -1;
  int i = 0;
  while (hi >= lo) {
    mid = (hi + lo) / 2;
    cout << mid << endl;
    fflush(stdout);
    cin >> ans;
    if (ans == 0) {
      exit(0);
    } else if (ans * t[i] == 1) {
      lo = mid + 1;
    } else {
      hi = mid - 1;
    }
    i = (i + 1) % n;
  }
}
