#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
int n, m;
bool lie[40];
int ask(int d) {
  int ret;
  cout << d << endl;
  cin >> ret;
  if (ret == 0) exit(0);
  return ret;
}
int main() {
  cin >> m >> n;
  for (int i = 0; i < n; i++)
    if (ask(m) == 1) lie[i] = true;
  int l = 1, r = m;
  int cnt = 0;
  while (l < r) {
    int mid = l + (r - l) / 2;
    int ans = ask(mid);
    if (lie[(cnt++) % n]) ans = -ans;
    if (ans > 0)
      l = mid + 1;
    else
      r = mid - 1;
  }
  ask(l);
}
