#include <bits/stdc++.h>
using namespace std;
int a[55];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cout << 1 << endl;
    fflush(stdout);
    int x;
    cin >> x;
    if (x == 0) {
      return 0;
    }
    if (x == -1)
      a[i] = 0;
    else
      a[i] = 1;
  }
  int ans = -1;
  for (int lt = 2, rt = n, i = 1;; i++) {
    int mid = (lt + rt) >> 1;
    cout << mid << endl;
    fflush(stdout);
    int x;
    cin >> x;
    if (!x) {
      return 0;
    }
    int t = (i - 1) % m + 1;
    if (a[t]) {
      if (x == 1)
        lt = mid + 1;
      else
        rt = mid - 1;
    } else {
      if (x == -1)
        lt = mid + 1;
      else
        rt = mid - 1;
    }
  }
  cout << ans << endl;
  return 0;
}
