#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long m, n;
  cin >> m >> n;
  bool a[n];
  cout << 1 << endl;
  long long ans;
  cin >> ans;
  if (ans == 0) {
    return 0;
  } else {
    if (ans == 1)
      a[0] = true;
    else
      a[0] = false;
    for (long long i = 1; i < n; i++) {
      cout << 1 << endl;
      cin >> ans;
      if (ans == 1)
        a[i] = true;
      else
        a[i] = false;
    }
    long long l = 1, r = m;
    long long cnt = 0;
    while (l <= r) {
      long long m = (l + r) / 2;
      cout << m << endl;
      cin >> ans;
      if (!a[cnt % n]) ans = ans * -1;
      if (ans == 0)
        break;
      else if (ans == -1) {
        r = m - 1;
      } else {
        l = m + 1;
      }
      cnt++;
    }
  }
  return 0;
}
