#include <bits/stdc++.h>
using namespace std;
const int N = 1300;
const int M = 60500;
const int inf = 1e9 + 7;
int n, m;
double load;
int a[N], b[N];
double c[N << 1];
int cnt = 0;
int f[50];
int main() {
  int res = 0;
  scanf("%d%d", &m, &n);
  for (int i = 1; i <= n; i++) {
    printf("1\n");
    fflush(stdout);
    scanf("%d", &f[i]);
    if (f[i] == 0) return 0;
  }
  int l = 1, r = m;
  for (int i = 1; i <= 60 - n; i++) {
    int mid = (l + r) >> 1;
    printf("%d\n", mid);
    fflush(stdout);
    scanf("%d", &res);
    int k;
    k = i % n;
    if (k == 0) k = n;
    res *= f[k];
    if (res == 0) return 0;
    if (res > 0)
      l = mid + 1;
    else
      r = mid - 1;
  }
  return 0;
}
