#include <bits/stdc++.h>
inline void query(int x) {
  printf("%d\n", x);
  fflush(stdout);
}
inline int answer() {
  int x;
  scanf("%d", &x);
  return x;
}
int a[40], q[40];
int main() {
  int m, n;
  scanf("%d%d", &m, &n);
  query(1);
  int a = answer();
  if (!a) {
    return 0;
  }
  if (a < 0) q[0] = 1;
  for (int i = 1; i < n; ++i) {
    query(1);
    a = answer();
    if (a < 0) q[i] = 1;
  }
  int num = -1;
  int left = 1, right = m;
  while (left < right) {
    int mid = left + right >> 1;
    ++num;
    num %= n;
    query(mid);
    int chk = answer();
    if (q[num]) chk = -chk;
    if (chk == 0) {
      return 0;
    }
    if (chk < 0)
      right = mid;
    else
      left = mid + 1;
  }
  query(left);
  return 0;
}
