#include <bits/stdc++.h>
using namespace std;
int d[31] = {0};
int main() {
  int m, n;
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    printf("%d\n", m);
    fflush(stdout);
    scanf("%d", &d[i]);
    d[i] = -d[i];
    if (d[i] == 0) exit(0);
  }
  int L = 1, R = m;
  int cnt = 0;
  while (R - L > 1) {
    int mid = (L + R) / 2;
    printf("%d\n", mid);
    fflush(stdout);
    int v;
    scanf("%d", &v);
    v *= d[cnt % n];
    if (v == 0)
      exit(0);
    else if (v == 1) {
      L = mid;
    } else {
      R = mid;
    }
    cnt++;
  }
  printf("%d\n", L);
  fflush(stdout);
  int x;
  scanf("%d", &x);
  if (!x) exit(0);
  return 0;
}
