#include <bits/stdc++.h>
using namespace std;
int m, n, seq[30];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    int t;
    cout << 1 << endl << flush;
    cin >> t;
    if (t == 0 || t == -2) return 0;
    if (t == -1)
      seq[i] = 0;
    else
      seq[i] = 1;
  }
  int s = s = 2, e = m;
  for (int i = n; i < 60; i++) {
    int mid = (s + e) / 2, t;
    cout << mid << endl << flush;
    cin >> t;
    if (t == 0) return 0;
    if (seq[i % n] == 0) t *= -1;
    if (t > 0)
      s = mid + 1;
    else
      e = mid - 1;
  }
}
