#include <bits/stdc++.h>
using namespace std;
inline int Gcd(int X, int Y) { return Y ? Gcd(Y, X % Y) : X; }
inline long long Gcd(long long X, long long Y) { return Y ? Gcd(Y, X % Y) : X; }
inline int Pow(int base, long long exp, int _mod) {
  if (!(base %= _mod)) return 0;
  int _ans = 1;
  for (; exp; exp >>= 1, base = (long long)base * base % _mod)
    exp& 1 ? _ans = (long long)_ans * base % _mod : 0;
  return _ans;
}
inline long long Pow(long long base, long long exp, long long _mod) {
  if (!(base %= _mod)) return 0;
  long long _ans = 1;
  for (; exp; exp >>= 1, base = base * base % _mod)
    exp& 1 ? _ans = _ans * base % _mod : 0;
  return _ans;
}
const int INF = 0x3f3f3f3f;
int n, m;
int seq[30];
int print(int x) {
  printf("%d\n", x);
  fflush(stdout);
  int d;
  scanf("%d", &d);
  return d;
}
int main() {
  scanf("%d%d", &m, &n);
  int d = print(1);
  if (!d) exit(0);
  seq[0] = d;
  for (int i = 1; i < n; ++i) seq[i] = print(1);
  int l = 2, r = m, mid;
  int cnt = 0;
  while (l <= r) {
    mid = l + r >> 1;
    int d = print(mid);
    if (!d) exit(0);
    if (d == seq[cnt])
      l = mid + 1;
    else
      r = mid - 1;
    cnt = (cnt + 1) % n;
  }
  return 0;
}
