#include <bits/stdc++.h>
using namespace std;
int n, m;
int p[40];
int main() {
  int x;
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    cout << 1 << endl;
    ;
    fflush(stdout);
    cin >> x;
    if (x == 0) return 0;
    if (x == -1)
      p[i] = -1;
    else
      p[i] = 1;
  }
  int low = 1, high = m, mid, cnt = 0;
  while (low <= high) {
    mid = (low + high) / 2;
    cout << mid << endl;
    fflush(stdout);
    cin >> x;
    x *= p[cnt];
    cnt++;
    cnt %= n;
    if (x == 0) return 0;
    if (x == 1)
      low = mid + 1;
    else
      high = mid - 1;
  }
  return 0;
}
