#include <bits/stdc++.h>
using namespace std;
int p[32];
int main() {
  int n, m;
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    cout << 1 << endl;
    cin >> p[i];
    if (p[i] == 0) {
      return 0;
    }
  }
  int cnt = 0;
  int l = 1, r = m;
  while (l <= r) {
    int mid = (l + r) >> 1;
    cout << mid << endl;
    int ans;
    cin >> ans;
    if (p[cnt] == -1) ans = -ans;
    cnt = (cnt + 1) % n;
    if (ans == 0) {
      return 0;
    }
    if (ans == 1) {
      l = mid + 1;
    } else
      r = mid - 1;
  }
  cout << (l + r) / 2 << endl;
  return 0;
}
