#include <bits/stdc++.h>
using namespace std;
int ans[35];
int main() {
  int n, m;
  cin >> m >> n;
  int aw;
  for (int i = 0; i < n; i++) {
    printf("1\n");
    fflush(stdout);
    scanf("%d", &aw);
    if (aw == 0) return 0;
    ans[i] = aw;
  }
  int l = 1, r = m;
  int cnt = 0;
  while (l <= r) {
    int mid = (l + r) / 2;
    printf("%d\n", mid);
    fflush(stdout);
    scanf("%d", &aw);
    if (aw == 0) return 0;
    aw *= ans[cnt];
    if (aw == 1)
      l = mid + 1;
    else
      r = mid - 1;
    cnt++;
    cnt %= n;
  }
  return 0;
}
