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