#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[30] = {}, f = 1;
  ;
  scanf("%i%i", &m, &n);
  for (int i = 0; i < n; i++) {
    printf("%i\n", m);
    fflush(stdout);
    int x;
    scanf("%i", &x);
    if (x == 0 || x == -2) {
      f = 0;
      break;
    } else {
      if (x == 1)
        a[i] = -1;
      else
        a[i] = 1;
    }
  }
  if (f == 1) {
    int low = 1, high = m - 1, mid = m / 2, i = 0;
    while (1) {
      printf("%i\n", mid);
      fflush(stdout);
      int x;
      scanf("%i", &x);
      if (x == 0 || x == -2) {
        f = 0;
        break;
      } else {
        if (x * a[i] == 1) {
          low = mid + 1;
          mid = (low + high) / 2;
        } else {
          high = mid - 1;
          mid = (low + high) / 2;
        }
      }
      i = (i + 1) % n;
    }
  }
  return 0;
}
