#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n, p;
  cin >> m >> n;
  bool f[40];
  for (int i = 0; i < n; i++) {
    cout << 1 << '\n';
    fflush(stdout);
    cin >> p;
    fflush(stdout);
    if (p == 0 || p == -2) exit(0);
    if (p == 1)
      f[i] = 1;
    else
      f[i] = 0;
  }
  int l = 1, r = m;
  while (1) {
    for (int i = 0; i < n; i++) {
      int mid = (l + r) / 2;
      cout << mid << '\n';
      fflush(stdout);
      cin >> p;
      fflush(stdout);
      if (p == 0 || p == -2) exit(0);
      if (f[i]) {
        if (p == 1)
          l = mid + 1;
        else
          r = mid - 1;
      } else {
        if (p == 1)
          r = mid - 1;
        else
          l = mid + 1;
      }
    }
  }
}
