#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long m, n;
  cin >> m >> n;
  long long first = 1, last = m;
  int seq[n + 1];
  for (int i = 1; i <= n; i++) {
    cout << 1 << endl;
    cout.flush();
    long long op;
    cin >> op;
    if (op == -1)
      seq[i] = 0;
    else if (op == 1)
      seq[i] = 1;
    else
      break;
  }
  int counter = 1;
  while (first <= last) {
    long long mid = (first + last) / 2;
    cout << mid << endl;
    cout.flush();
    if (counter > n) counter = 1;
    int op;
    cin >> op;
    if (seq[counter] == 0) op *= -1;
    if (op == -1)
      last = mid - 1;
    else if (op == 1)
      first = mid + 1;
    else
      break;
    counter++;
  }
  return 0;
}
