#include <bits/stdc++.h>
using namespace std;
long long ask(long long v) {
  cout << v << endl;
  long long ans;
  cin >> ans;
  return ans;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, m;
  cin >> m >> n;
  long long p[n];
  fill(p, p + n, 0);
  for (long long i = 0; i < n; ++i) {
    long long res = ask(m);
    if (res == 0) {
      exit(0);
    }
    p[i] = res == -1;
  }
  long long l = 1, r = m;
  long long it = 0;
  for (long long i = 0; i < 30; ++i) {
    if (l >= r) break;
    long long mid = (l + r) / 2;
    long long res = ask(mid);
    if (!p[it++]) res *= -1;
    it %= n;
    if (res == 0) exit(0);
    if (res == -1) {
      r = mid;
    } else
      l = mid + 1;
  }
  if (ask(l) == 0) exit(0);
  ask(r);
  exit(0);
}
