#include <bits/stdc++.h>
using namespace std;
int n, m, c[35], times, cur;
const int f[] = {-1, 1};
int chk(int x) {
  cout << x << endl;
  fflush(stdout);
  cin >> cur;
  if (!cur)
    exit(0);
  else
    return f[c[times % n]] * cur;
}
int main() {
  cin >> m >> n;
  for (int i = 1; i <= n; i++) {
    cout << m << endl;
    fflush(stdout);
    cin >> cur;
    if (cur == 0)
      return 0;
    else if (cur == -1)
      c[i % n] = 1;
  }
  int l = 1, r = m;
  times = n;
  while (l <= r) {
    times++;
    int mid = l + r >> 1;
    if (chk(mid) == -1)
      r = mid - 1;
    else
      l = mid + 1;
  }
}
