#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1.0l);
const long long MOD = 1e9 + 7;
bool debug = 1;
const int N = -1;
int v[40];
int main() {
  int n, maxd;
  scanf("%d%d", &maxd, &n);
  for (int i = 0; i < n; i++) {
    printf("%d\n", maxd);
    fflush(stdout);
    int x;
    scanf("%d", &x);
    if (x == 0) {
      return 0;
    }
    if (x < 0) v[i] = 1;
  }
  int id = 0;
  int lo = 1, hi = maxd;
  while (1) {
    int mid = (lo + hi) / 2;
    printf("%d\n", mid);
    fflush(stdout);
    int ok;
    scanf("%d", &ok);
    if (ok == 0 or ok == 2) {
      return 0;
    }
    if (v[id] == 0) ok = ok * (-1);
    id = (id + 1) % n;
    if (ok > 0) {
      lo = mid + 1;
    } else {
      hi = mid;
    }
  }
  return 0;
}
