#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n, x;
  cin >> m >> n;
  vector<int> ver(n);
  for (int i = 0; i < n; ++i) {
    cout << 1 << endl;
    fflush(stdout);
    cin >> ver[i];
    if (ver[i] == 0) return 0;
  }
  int lo = 0, hi = m + 1, i = 0;
  while (hi != lo) {
    int mid = (hi + lo) >> 1;
    cout << mid << endl;
    fflush(stdout);
    cin >> x;
    if (x == 0) return 0;
    if (ver[i] == -1) x = -x;
    if (x == 1)
      lo = mid;
    else
      hi = mid;
    i = (i + 1) % n;
  }
  cout << hi << endl;
  fflush(stdout);
  return 0;
}
