#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  size_t n, m;
  cin >> m >> n;
  vector<int> sequence(n);
  for (auto &e : sequence) {
    cout << 1 << endl;
    cin >> e;
    if (e == 0) return 0;
    if ((e != +1) && (e != -1)) return 0;
  }
  size_t start = 1, end = m;
  for (size_t i = 0; i < 60 - n; i++) {
    if (start > end) return 0;
    auto guess = (start + end) >> 1;
    cout << guess << endl;
    int e;
    cin >> e;
    e *= sequence[i % n];
    if (e == 0) return 0;
    if ((e != +1) && (e != -1)) return 0;
    if (e > 0)
      start = guess + 1;
    else
      end = guess - 1;
  }
}
