#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, i, j, a, k;
  bool x[300];
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cout << n << "\n";
    fflush(stdout);
    cin >> a;
    if (a == 0) exit(0);
    if (a == -1)
      x[i] = true;
    else
      x[i] = false;
  }
  a = -1;
  long long l = 0, r = n, mid = 0;
  i = 0;
  while (a != 0) {
    n = (r + l) / 2;
    cout << n << "\n";
    fflush(stdout);
    cin >> a;
    if (a == -2) exit(0);
    if (a == 0) exit(0);
    if (x[i] == false) a = a * -1;
    i++;
    if (i == m) i = 0;
    if (a == -1) {
      r = n;
    } else
      l = n;
  }
}
