#include <bits/stdc++.h>
using namespace std;
const int siz = 1e5 + 10;
const long long modu = 1e9 + 7;
int main() {
  int m, n;
  scanf("%d%d", &m, &n);
  int arr[n];
  for (int i = 0; i < n; i++) {
    printf("1\n");
    fflush(stdout);
    int x;
    scanf("%d", &x);
    if (x == 0) return 0;
    if (x == -1)
      arr[i] = 1;
    else
      arr[i] = 0;
  }
  int ind = 0;
  int l = 1, h = m;
  while (1) {
    int m = (l + h) / 2;
    printf("%d\n", m);
    fflush(stdout);
    int x;
    scanf("%d", &x);
    if (arr[ind]) x = -x;
    if (x == 0) return 0;
    if (x == -1)
      h = m;
    else if (x == 1)
      l = m + 1;
    ind = (ind + 1) % n;
  }
  return 0;
}
