#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll query(ll y) {
  cout << y << endl;
  cout.flush();
  ll res;
  cin >> res;
  if (res == 0) exit(0);
  if (res == -2) exit(1);
  return res;
}
void solve() {
  ll n, x;
  cin >> x >> n;
  vector<int> p(n);
  ll l = 0, r = x;
  for (long long i = (0); i < (long long)(n); i++) {
    ll res = query(x);
    if (res == -1)
      p[i] = 1;
    else
      p[i] = -1;
  }
  for (long long i = (n); i < (long long)(60); i++) {
    ll m = (l + r) / 2;
    ll res = query(m) * p[i % n];
    if (res == -1)
      r = m;
    else
      l = m;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
  return 0;
}
