#include <bits/stdc++.h>
using namespace std;
int m, n, r;
int query(int q) {
  cout << q << endl;
  cin >> r;
  return r;
}
int v[33];
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    if (query(m) == 0) return 0;
    v[i] = -r;
  }
  int lo = 1, hi = m;
  for (int i = 0; i < 30; i++) {
    int mid = (lo + hi) / 2;
    if (query(mid) == 0) return 0;
    r *= v[i % n];
    if (r == -1) {
      hi = mid;
    } else {
      lo = mid;
    }
  }
}
