#include <bits/stdc++.h>
using namespace std;
int N, M, res[1001], v;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> M >> N;
  for (int i = 1; i <= N; i++) {
    cout << 1 << endl;
    cin >> res[i];
    if (res[i] == 0) exit(0);
  }
  int ini = 1, fin = M;
  for (int i = 1;; i++) {
    if (i > N) i = 1;
    int mid = (ini + fin) / 2;
    cout << mid << endl;
    cin >> v;
    if (!v) exit(0);
    if (res[i] == 1) {
      if (v == 1)
        ini = mid + 1;
      else
        fin = mid - 1;
    } else {
      if (v == -1)
        ini = mid + 1;
      else
        fin = mid - 1;
    }
  }
}
