#include <bits/stdc++.h>
using namespace std;
const int MAXN = 30 + 10;
int m, n, ans, cnt, ok[MAXN];
bool ask(int val) {
  printf("%d\n", val);
  fflush(stdout);
  scanf("%d", &ans);
  if (ans == 0)
    exit(0);
  else
    return ans > 0;
}
int main(void) {
  scanf("%d%d", &m, &n);
  for (int i = 1; i <= n; i++) ok[i] = ask(1);
  int st = 1, en = m, md;
  while (st != en) {
    cnt++;
    if (cnt == n + 1) cnt = 1;
    md = (st + en) >> 1;
    if (ask(md) ^ ok[cnt])
      en = md;
    else
      st = md + 1;
  }
  ask(st);
  return 0;
}
