#include <bits/stdc++.h>
using namespace std;
void geth(int in, int& out) {
  cout << in << endl;
  cin >> out;
  if (out != 1 && out != -1) {
    exit(0);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, mx;
  cin >> mx >> n;
  std::vector<int> pp(n);
  for (auto&& x : pp) {
    geth(1, x);
  }
  int l = 2;
  int r = mx;
  int tr = 0;
  while (l < r) {
    int mid = (l + r) / 2, res;
    geth(mid, res);
    res *= pp[tr];
    if (res > 0) {
      l = mid + 1;
    } else if (res < 0) {
      r = mid - 1;
    }
    tr = (tr + 1) % n;
  }
  geth(l, r);
}
