#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void ckmax(T& x, T y) {
  x = (y > x ? y : x);
}
template <typename T>
inline void ckmin(T& x, T y) {
  x = (y < x ? y : x);
}
int m, n;
int f[35];
int ask(int y) {
  cout << y << endl;
  int res;
  cin >> res;
  return res;
}
int main() {
  cin >> m >> n;
  for (int i = 0; i < n; ++i) {
    f[i] = ask(1);
    if (f[i] == 0) {
      return 0;
    }
  }
  int l = 1, r = m;
  int cur = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    int x = ask(mid);
    if (x == 0) {
      return 0;
    }
    x *= f[cur % n];
    cur++;
    if (x == -1)
      r = mid - 1;
    else
      l = mid + 1;
  }
  return 114514;
}
