#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, ans;
  cin >> m >> n;
  vector<long long> arr;
  for (int i = 0; i < n; i++) {
    cout << 1 << '\n';
    fflush(stdout);
    cin >> ans;
    if (ans == 0 || ans == -2) exit(0);
    arr.push_back(ans);
  }
  long long low = 2, high = m;
  int i = 0;
  while (low <= high) {
    int mid = (low + high) / 2;
    cout << mid << '\n';
    fflush(stdout);
    cin >> ans;
    if (ans == 0 || ans == -2) exit(0);
    if (arr[i] == 1) {
      if (ans == 1)
        low = mid + 1;
      else
        high = mid - 1;
    } else {
      if (ans == 1)
        high = mid - 1;
      else
        low = mid + 1;
    }
    i = (i + 1) % n;
  }
  return 0;
}
