#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int temp;
  long long int n, m, lo, hi, mid, curr, flag = 0;
  vector<int> v(n);
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    printf("1\n");
    fflush(stdout);
    scanf("%d", &temp);
    if (temp == -2) exit(0);
    if (temp == 0) exit(0);
    if (temp == 1)
      v[i] = 1;
    else
      v[i] = 0;
  }
  curr = 0;
  lo = 1;
  hi = m;
  while (!flag) {
    mid = lo + (hi - lo) / 2;
    printf("%ld\n", mid);
    fflush(stdout);
    scanf("%d", &temp);
    if (temp == -2) exit(0);
    if (temp == 0) exit(0);
    if (!v[curr]) temp *= -1;
    if (temp == 1)
      lo = mid + 1;
    else
      hi = mid - 1;
    curr++;
    curr %= n;
  }
  exit(0);
}
