#include <bits/stdc++.h>
using namespace std;
const int maxn = 100050;
int f[maxn];
int main() {
  int m, n;
  scanf("%d%d", &m, &n);
  for (int i = 0; i <= 100; ++i) f[i] = 1;
  int l = 1, r = m;
  for (int i = 1; i <= 60; ++i) {
    int y;
    if (i <= n) {
      printf("%d\n", m);
      fflush(stdout);
      scanf("%d", &y);
      if (y > 0)
        f[i] = -1;
      else if (y == 0)
        return 0;
    } else {
      int mid = (l + r) >> 1;
      printf("%d\n", mid);
      fflush(stdout);
      scanf("%d", &y);
      int j = i % n;
      if (j == 0) j = n;
      y *= f[j];
      if (y == 0) {
        return 0;
      }
      if (y > 0)
        l = mid + 1;
      else
        r = mid - 1;
    }
  }
  return 0;
}
