#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;
  vector<long long> P;
  for (int i = 0; i < N; ++i) {
    cout << 1 << endl;
    long long x;
    cin >> x;
    if (0 == x) {
      return 0;
    }
    if (x == -1)
      P.push_back(1);
    else
      P.push_back(-1);
  }
  long long x = M, n = 2;
  for (int i = 0; i < 30; i++) {
    long long cand = (x + n) / 2;
    cout << cand << endl;
    long long z;
    cin >> z;
    if (P[i % N] * z == 0) return 0;
    if (P[i % N] * z > 0) {
      x = cand - 1;
    } else {
      n = cand + 1;
    }
  }
}
