#include <bits/stdc++.h>
using namespace std;
int x, n, a[66], now;
int main() {
  cin >> x >> n;
  for (int i = 1; i <= n; i++) {
    printf("1\n");
    fflush(stdout);
    cin >> a[i];
    if (a[i] == 0) exit(0);
  }
  int l = 0, r = x + 1;
  while (l != r) {
    int mid = l + r >> 1;
    printf("%d\n", mid);
    fflush(stdout);
    int t;
    cin >> t;
    if (t == 0) exit(0);
    now++;
    if (now > n) now = 1;
    if (a[now] == -1) {
      t = -t;
    }
    if (t == 1)
      l = mid + 1;
    else
      r = mid;
  }
  printf("%d\n", l);
  fflush(stdout);
}
