#include <bits/stdc++.h>
using namespace std;
bool c[60];
int main() {
  int m, n;
  scanf("%d %d", &m, &n);
  memset(c, 0, sizeof c);
  for (int i = 0; i < n; ++i) {
    printf("%d\n", 1);
    fflush(stdout);
    int get;
    scanf(" %d", &get);
    if (get == 0) {
      return 0;
    } else if (get == 1) {
      c[i] = true;
    }
  }
  int l = 2;
  int r = m;
  int co = 0;
  while (l <= r) {
    int mid = l + (r - l) / 2;
    printf("%d\n", mid);
    fflush(stdout);
    int get;
    scanf(" %d", &get);
    if (!c[co]) {
      get = -get;
    }
    if (get == 0) return 0;
    if (get == 1) {
      l = mid + 1;
    } else {
      r = mid - 1;
    }
    ++co;
    co %= n;
  }
  return 0;
}
