#include <bits/stdc++.h>
using namespace std;
int main() {
  long long max_dist, n_p;
  cin >> max_dist >> n_p;
  vector<int> seq;
  for (int i = 0; i < n_p; i++) {
    cout << 1 << endl;
    fflush(stdout);
    int resp;
    cin >> resp;
    if (resp == 0 || resp == -2) {
      return 0;
    }
    seq.push_back(resp);
  }
  int dmin = 1, dmax = max_dist + 1, qno = 0;
  while (true) {
    int dmid = (dmax + dmin) / 2;
    cout << dmid << endl;
    fflush(stdout);
    int resp;
    cin >> resp;
    if (resp == 0 || resp == -2) {
      return 0;
    }
    if (seq[qno] == 1) {
      if (resp == 1) {
        dmin = dmid;
      } else {
        dmax = dmid;
      }
    } else {
      if (resp == 1) {
        dmax = dmid;
      } else {
        dmin = dmid;
      }
    }
    qno = (qno + 1) % n_p;
  }
  return 0;
}
