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