#include <bits/stdc++.h>
using namespace std;
int m, n;
int ask(int x) {
  int ans;
  cout << x << endl;
  fflush(stdout);
  cin >> ans;
  if (ans == -2) throw;
  return ans;
}
int ans[50];
int main() {
  cin >> m >> n;
  for (int i = 1; i <= n; i++) {
    int t = ask(1);
    if (t == 0)
      return 0;
    else
      ans[i] = t;
  }
  int L = 2, R = m, mid, id = 0;
  while (L <= R) {
    mid = (L + R) >> 1;
    ++id;
    if (id == n + 1) id = 1;
    int fi = ask(mid) * ans[id];
    if (fi == 0)
      return 0;
    else if (fi == -1)
      R = mid - 1;
    else
      L = mid + 1;
  }
  return 0;
}
