#include <bits/stdc++.h>
using namespace std;
int a[31];
int ask(int q) {
  cout << q << endl;
  int res;
  cin >> res;
  if (!res) exit(0);
  return res;
}
int main() {
  cin.tie(0), ios_base::sync_with_stdio(0);
  int m, n;
  cin >> m >> n;
  for (int i = 0; i < n; i++) a[i] = ask(1);
  int l = 2, r = m, cnt = 0;
  while (l != r) {
    int mid = (l + r) >> 1;
    if (ask(mid) * a[cnt % n] == 1)
      l = mid + 1;
    else
      r = mid;
    cnt++;
  }
  ask(l);
}
