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