#include <bits/stdc++.h>
using namespace std;
int n, m, f[110];
int rd() {
  int s = 0, ff = 1;
  char w = getchar();
  while (w < '0' || w > '9') {
    if (w == '-') ff = -1;
    w = getchar();
  }
  while (w >= '0' && w <= '9') {
    s = s * 10 + (w - '0');
    w = getchar();
  }
  return s * ff;
}
int main() {
  m = rd(), n = rd();
  for (int i = 0; i < n; i++) {
    printf("1\n");
    fflush(stdout);
    int x = rd();
    f[i] = x;
    if (!x) return 0;
  }
  int l = 1, r = m, t = 0;
  while (1) {
    int mid = (l + r) / 2;
    printf("%d\n", mid);
    fflush(stdout);
    int x = rd();
    if (!x) break;
    int y = (x * f[t]);
    if (y == -1)
      r = mid - 1;
    else
      l = mid + 1;
    t++;
    t %= n;
  }
  return 0;
}
