#include <bits/stdc++.h>
using namespace std;
int b[31];
int main() {
  int m, n, i, l, r, temp;
  cin >> m >> n;
  l = max(1, m / 2), r = m;
  if (n < 6) n *= 2;
  if (n <= 13) n *= 2;
  for (i = 1; i <= n; i++) {
    printf("%d\n", l);
    fflush(stdout);
    scanf("%d", &b[i]);
    if (b[i] == 0) exit(0);
  }
  printf("%d\n", r);
  fflush(stdout);
  scanf("%d", &temp);
  if (temp == 0) exit(0);
  if (b[1] != temp) {
    l = m / 2, r = m;
    for (i = 2; i <= n; i++) {
      printf("%d\n", (l + r) / 2);
      fflush(stdout);
      scanf("%d", &temp);
      if (temp == 0)
        exit(0);
      else if (temp == b[i])
        l = (l + r) / 2 + 1;
      else
        r = (l + r) / 2;
    }
    while (1) {
      for (i = 1; i <= n; i++) {
        printf("%d\n", (l + r) / 2);
        fflush(stdout);
        scanf("%d", &temp);
        if (temp == 0)
          exit(0);
        else if (temp == b[i])
          l = (l + r) / 2 + 1;
        else
          r = (l + r) / 2;
      }
    }
  } else {
    l = 0, r = m / 2;
    for (i = 2; i <= n; i++) {
      printf("%d\n", (l + r) / 2);
      fflush(stdout);
      scanf("%d", &temp);
      if (temp == 0)
        exit(0);
      else if (temp == b[i])
        r = (l + r) / 2;
      else
        l = (l + r) / 2 + 1;
    }
    while (1) {
      for (i = 1; i <= n; i++) {
        printf("%d\n", (l + r) / 2);
        fflush(stdout);
        scanf("%d", &temp);
        if (temp == 0)
          exit(0);
        else if (temp == b[i])
          r = (l + r) / 2;
        else
          l = (l + r) / 2 + 1;
      }
    }
  }
}
