#include <bits/stdc++.h>
using namespace std;
const int maxn = 35;
int n, m, p[maxn];
int main() {
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    cout << 1 << endl;
    fflush(stdout);
    int x;
    cin >> x;
    if (!x || x == -2) return 0;
    if (x == 1) p[i] = true;
  }
  int l = 1, r = m, cnt = 0;
  for (;; cnt++) {
    int mid = (l + r) / 2;
    cout << mid << endl;
    fflush(stdout);
    int x;
    scanf("%d", &x);
    if (!x || x == -2) return 0;
    if ((!p[cnt % n]) ^ (x == 1))
      l = mid + 1;
    else
      r = mid - 1;
  }
}
