#include <bits/stdc++.h>
using namespace std;
int m, n, k, k1;
int b[32];
int main() {
  cin >> m >> n;
  cout << m << "\n";
  fflush(stdout);
  cin >> k1;
  if (k1 == 0) {
    return 0;
  }
  if (k1 == 1) {
    b[0] = -1;
  } else
    b[0] = 1;
  for (int i = 1; i < n; i++) {
    cout << m << "\n";
    fflush(stdout);
    cin >> k1;
    if (k1 == 1) {
      b[i] = -1;
    } else
      b[i] = 1;
  }
  int left = 1, right = m, mid, ans = -1;
  for (int i = 0; i < 60 - n && left <= right; i++) {
    mid = (left + right) / 2;
    cout << mid << endl;
    fflush(stdout);
    cin >> k;
    k *= b[i % n];
    if (k == 0) {
      ans = mid;
      break;
    }
    if (k == 1) {
      left = mid + 1;
    } else
      right = mid - 1;
  }
  return 0;
}
