#include <bits/stdc++.h>
using namespace std;
const int inf = 1ULL << 31U - 1;
const long long linf = 1ULL << 63U - 1;
const string nilstr("");
char encode(char c) {
  return c >= 'A' && c <= 'Z' ? c - 'A' : c - 'a' + (char)26;
}
char decode(char i) { return i < 26 ? i + 'A' : i - (char)26 + 'a'; }
template <typename T>
T &checkmax(T &a, const T &b) {
  if (a < b) a = b;
  return a;
}
template <typename T>
T &checkmin(T &a, const T &b) {
  if (a > b) a = b;
  return a;
}
template <typename T>
void swapmax(T &a, T &b) {
  if (a > b) swap(a, b);
}
int main() {
  unsigned m, n;
  cin >> m >> n;
  vector<int> w(n);
  for (unsigned i = 0; i < n; i++) {
    cout << 1 << endl;
    fflush(stdout);
    cin >> w[i];
    if (w[i] == 0) return 0;
  }
  unsigned l = 1, r = m + 1, t = 0;
  while (l + 1 < r) {
    unsigned m = (l + r) >> 1u;
    int x;
    cout << m << endl;
    fflush(stdout);
    cin >> x;
    if (x == 0) return 0;
    if (w[t] * x == 1)
      l = m;
    else
      r = m;
    t++;
    t %= n;
  }
  cout << l << endl;
  fflush(stdout);
}
