#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m >> n;
  vector<bool> positive;
  for (int i = 1; i <= n; i++) {
    cout << m << endl;
    cout << flush;
    int answer;
    cin >> answer;
    if (answer == 0) {
      return 0;
    }
    positive.push_back(answer < 0);
  }
  int low = 1;
  int high = m;
  int i = 0;
  while (low <= high) {
    int mid = (low + high) / 2;
    cout << mid << endl;
    cout << flush;
    int answer;
    cin >> answer;
    if (answer == 0) {
      return 0;
    }
    if (!positive[i % n]) {
      answer = -answer;
    }
    if (answer < 0) {
      high = mid - 1;
    } else {
      low = mid + 1;
    }
    i++;
  }
}
