#include <bits/stdc++.h>
int a[60];
int n, m;
using namespace std;
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cout << n << endl;
    fflush(stdout);
    cin >> a[i];
    if (a[i] == 0) return 0;
  }
  int l = 1, r = n, mid, re, i;
  i = 0;
  while (true) {
    mid = (l + r) / 2;
    cout << mid << endl;
    fflush(stdout);
    cin >> re;
    if (re == 0) return 0;
    if (re * a[i] == -1)
      l = mid + 1;
    else
      r = mid - 1;
    i = (i + 1) % m;
  }
}
