#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m >> n;
  vector<int> trueandfalse;
  for (int i = 0; i < n; i++) {
    cout << 1 << "\n";
    fflush(stdout);
    int ans;
    cin >> ans;
    if (ans == 0) {
      return 0;
    } else if (ans == 1) {
      trueandfalse.push_back(1);
    } else if (ans == -1) {
      trueandfalse.push_back(-1);
    } else {
      return 0;
    }
  }
  int l = 1;
  int r = m;
  int i = 0;
  while (true) {
    i %= n;
    int mid = l + (r - l) / 2;
    cout << mid << "\n";
    fflush(stdout);
    int ans;
    cin >> ans;
    ans *= trueandfalse[i];
    if (ans == 0) {
      return 0;
    } else if (ans == -1) {
      r = mid - 1;
    } else if (ans == 1) {
      l = mid + 1;
    } else {
      return 0;
    }
    i++;
  }
}
