#include <bits/stdc++.h>
using namespace std;
const int Z = 3 * (int)1e5 + 111;
const int INF = (int)1e9 + 111;
const int MODF = (int)1e9 + 7;
int a[Z];
int main() {
  int n, m;
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    cout << 1 << endl;
    cin >> a[i];
    if (!a[i]) exit(0);
  }
  int l = 2, r = m + 1, op = 0;
  while (r - l > 1) {
    int mid = (l + r) / 2, x;
    cout << mid << endl;
    cin >> x;
    if (!x) exit(0);
    if (a[op] * x == 1)
      l = mid + 1;
    else
      r = mid;
    op = (op + 1) % n;
  }
  cout << l << endl;
  return 0;
}
