#include <bits/stdc++.h>
const static long long INF = 0x3f3f3f3f3f3f3f3f;
static inline void setio(void);
long long seq[31];
int main(void) {
  setio();
  long long n, m;
  std::cin >> m >> n;
  for (long long i = 0; i < n; ++i) {
    std::cout << "1" << std::endl;
    long long a;
    std::cin >> a;
    if (a == 0) {
      return 0;
    }
    if (a < 0)
      seq[i] = 0;
    else
      seq[i] = 1;
  }
  long long lo = 1, hi = m;
  long long i = 0;
  while (hi > lo) {
    long long mid = (hi + lo) / 2;
    std::cout << mid << std::endl;
    long long ans;
    std::cin >> ans;
    if (ans == -2) return 0;
    if (seq[i] == 0) ans *= -1;
    if (ans == 0) {
      return 0;
    }
    if (ans < 0)
      hi = mid - 1;
    else
      lo = mid + 1;
    ++i;
    i %= n;
  }
  std::cout << lo << "\n";
  return 0;
}
static inline void setio(void) {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.precision(10);
  std::cout << std::fixed;
}
