#include <bits/stdc++.h>
using namespace std;
int get(int m, int a) {
  if (a > m) a = m;
  if (a < 1) a = 1;
  printf("%d\n", a);
  fflush(stdout);
  int flag = 0;
  scanf("%d", &flag);
  if (!flag) exit(0);
  return flag;
}
int main() {
  int m, n;
  scanf("%d %d", &m, &n);
  int* b = new int[n];
  for (int i = 0; i < n; i++) {
    b[i] = get(m, i + 1);
  }
  int left = 0;
  int right = 2;
  int maxi = 1;
  while (right <= m) {
    maxi++;
    right *= 2;
  }
  for (int i = n; i < n + maxi; i++) {
    int avg = (left + right) / 2;
    int flag = (get(m, avg) * b[i % n]);
    if (flag == 1) {
      left = avg;
    } else if (flag == -1) {
      right = avg;
    }
  }
  return 0;
}
