#include <bits/stdc++.h>
using namespace std;
int ask(long long x) {
  cout << x << endl;
  int r;
  cin >> r;
  return r;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long m;
  int n;
  cin >> m;
  cin >> n;
  int r;
  vector<bool> truth(n, true);
  for (int i = 0; i < n; i++) {
    r = ask(m);
    if (r == 0) {
      exit(0);
    }
    if (r == 1) {
      truth[i] = false;
    }
  }
  long long left = 1, right = m;
  int index = 0;
  while (left < right) {
    long long mid = (left + right) / 2;
    r = ask(mid);
    r = truth[index % n] ? r : -r;
    index++;
    if (r == 0) {
      exit(0);
    } else if (r < 0) {
      right = mid;
    } else {
      left = mid + 1;
    }
  }
  return 0;
}
