#include <bits/stdc++.h>
#pragma GCC optimize(3, "inline", "Ofast")
using namespace std;
int a[40], nw;
int main() {
  int n, m;
  cin >> m >> n;
  for (int i = 1; i <= n; i++) {
    cout << 1 << endl;
    fflush(stdout);
    cin >> nw;
    if (nw == 0)
      return 0;
    else
      a[i] = nw;
  }
  int l = 1, r = m, mid;
  for (int i = 1;; i++) {
    mid = (l + r) >> 1;
    cout << mid << endl;
    fflush(stdout);
    cin >> nw;
    if (nw == 0) return 0;
    if (a[i] == -1) nw = -nw;
    if (nw == 1)
      l = mid + 1;
    else
      r = mid - 1;
    if (i == n) i -= n;
  }
}
