#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return b < a ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
const int oo = 0x3f3f3f3f;
const int maxn = 30;
int p[maxn + 5];
int main() {
  int m, n;
  scanf("%d%d", &m, &n);
  for (int i = (0), i_end_ = (n); i < i_end_; ++i) {
    printf("1\n");
    fflush(stdout);
    scanf("%d", p + i);
    if (!p[i]) exit(0);
    p[i] = p[i] == 1;
  }
  int l = 1, r = m;
  int cur = 0;
  while (l < r) {
    int mid = (l + r + 1) >> 1;
    printf("%d\n", mid);
    fflush(stdout);
    int first;
    scanf("%d", &first);
    if (p[cur]) first = -first;
    if (!first) exit(0);
    if (first == 1) r = mid - 1;
    if (first == -1) l = mid + 1;
    (++cur) %= n;
  }
  printf("%d\n", l);
  return 0;
}
