#include <bits/stdc++.h>
using namespace std;
int query(int y) {
  cout << y << "\n";
  fflush(stdout);
  int x;
  cin >> x;
  if (x == 0 || x == -2) {
    exit(0);
  }
  return x;
}
int main() {
  long long int m;
  int n;
  cin >> m >> n;
  int p[n];
  for (int i = 0; i <= n - 1; i++) {
    p[i] = (query(1) == 1);
  }
  long long int lo = 2, hi = m;
  long long int md = 0;
  int i = 0;
  while (true) {
    md = (lo + hi) / 2;
    int qa = query(md);
    if (p[i] == 0) {
      qa = -qa;
    }
    if (qa == 1) {
      lo = md + 1;
    } else {
      hi = md - 1;
    }
    i += 1;
    i %= n;
  }
}
