#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
bool ask(long long n) {
  cout << n << endl;
  long long q;
  cin >> q;
  if (q == 0) {
    exit(0);
  }
  if (q == -1) {
    return true;
  } else {
    return false;
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long m, n;
  cin >> m >> n;
  vector<bool> asks(n);
  for (long long i = 0; i < n; ++i) {
    asks[i] = ask(1);
  }
  long long l = 0, r = m + 1;
  long long ind = 0;
  while (r - l > 1) {
    long long mid = (l + r) / 2;
    bool fl = ask(mid);
    if (asks[ind]) fl = !fl;
    if (fl) {
      r = mid;
    } else
      l = mid;
    ind++;
    ind %= n;
  }
  ask(l);
  ask(r);
  return 0;
}
