#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const long long mos = 0x7FFFFFFF;
const long long nmos = 0x80000000;
const int inf = 0x3f3f3f3f;
template <typename T>
inline T read(T& x) {
  x = 0;
  int f = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') f |= (ch == '-'), ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x = f ? -x : x;
}
int x;
int a[50];
int main() {
  int m, n;
  scanf("%d%d", &m, &n);
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    printf("%d\n", 1);
    fflush(stdout);
    int ck;
    scanf("%d", &ck);
    if (ck == 0) {
      exit(0);
    }
    if (ck != 1) a[i] = 1;
  }
  int le = 0, ri = m + 1;
  while (le <= ri) {
    int mid = (le + ri) / 2;
    printf("%d\n", mid);
    fflush(stdout);
    int ck;
    scanf("%d", &ck);
    if (ck == 0) {
      exit(0);
    }
    if (a[cnt % n]) ck = -ck;
    cnt++;
    if (ck > 0) {
      le = mid + 1;
    } else
      ri = mid - 1;
  }
  return 0;
}
