#include <bits/stdc++.h>
using namespace std;
int n, m, i, rez, x, S[55], ind;
int main() {
  ios::sync_with_stdio(false);
  cin >> m >> n;
  for (i = 1; i <= n; i++) {
    cout << m << "\n";
    fflush(stdout);
    cin >> x;
    if (x == 0) return 0;
    if (x == -1)
      S[i] = 1;
    else
      S[i] = -1;
  }
  ind = 1;
  for (i = 29; i >= 0; i--) {
    if (rez + (1 << i) <= m) {
      cout << (rez + (1 << i)) << "\n";
      fflush(stdout);
      cin >> x;
      x = x * (S[ind]);
      ind++;
      if (ind > n) ind = 1;
      if (x == 0) return 0;
      if (x == 1) rez = rez + (1 << i);
    }
  }
  rez++;
  cout << rez << "\n";
  fflush(stdout);
  return 0;
}
