#include <bits/stdc++.h>
using namespace std;
int a[50];
int main() {
  int n, m, k, p = -1;
  cin >> n >> k;
  for (int i = 0; i < k; i++) {
    puts("1");
    cin >> a[i];
    if (a[i] == 0) return 0;
  }
  int l = 1, r = n, x;
  while (l <= r) {
    m = (l + r) / 2;
    p++;
    p %= k;
    cout << m << endl;
    cin >> x;
    if (x == 0) return 0;
    x = x * a[p];
    if (x == -1)
      r = m;
    else
      l = m + 1;
  }
}
