#include <bits/stdc++.h>
using namespace std;
const int MAXN = 55;
bool ch[MAXN];
int m, n, x, p = 0;
int check(int y) {
  cout << y << endl;
  int r;
  cin >> r;
  p++;
  if (p > n) p -= n;
  if (ch[p] == 1)
    return r;
  else
    return -r;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> m >> n;
  for (int i = 1; i <= n; i++) {
    cout << m - i + 1 << endl;
    cin >> x;
    if (x == 0) exit(0);
    if (x == -1)
      ch[i] = 1;
    else
      ch[i] = 0;
  }
  int l = 1, r = m - n;
  while (l <= r) {
    int y = (l + r) >> 1;
    int ret = check(y);
    if (ret == 0) exit(0);
    if (ret == -1)
      r = y - 1;
    else
      l = y + 1;
  }
  return 0;
}
