#include <bits/stdc++.h>
using namespace std;
int main() {
  long long m, n;
  cin >> m >> n;
  vector<long long> p(n);
  long long i = 0;
  while (i < n) {
    long long out = m, in;
    cout << out << "\n";
    fflush(stdout);
    cin >> in;
    p[i] = (in == -1);
    ++i;
  }
  long long c = 1, be = 1, en = m;
  i = 0;
  while (c <= 30) {
    long long mid = be + (en - be) / 2, in;
    cout << mid << "\n";
    fflush(stdout);
    cin >> in;
    if (abs(in) != 1) {
      return 0;
    }
    if (p[i]) {
      if (in == 1) {
        be = mid + 1;
      } else {
        en = mid;
      }
    } else {
      if (in == 1) {
        en = mid;
      } else {
        be = mid + 1;
      }
    }
    i = (i + 1) % n;
    ++c;
  }
  return 0;
}
