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