#include <bits/stdc++.h>
using namespace std;
const int maxn = 66;
int n, m, flg;
bool vis[maxn];
int main() {
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    cout << 1 << endl;
    fflush(stdout);
    cin >> flg;
    if (flg == 0) return 0;
    if (flg == 1) vis[i] = true;
    if (flg == -1) vis[i] = false;
  }
  int l = 1, r = m;
  int cnt = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    cout << mid << endl;
    fflush(stdout);
    cin >> flg;
    if (flg == 0) return 0;
    if ((flg == 1 && vis[cnt]) || (flg == -1 && vis[cnt] == false))
      l = mid + 1;
    else
      r = mid - 1;
    cnt = (cnt + 1) % n;
  }
  return 0;
}
