#include <bits/stdc++.h>
using namespace std;
long long int m, N, x, binary, ats, i = 0, t = 1;
long long p[60] = {0};
int main() {
  cin >> m >> N;
  x = m / 2 + m % 2;
  binary = m / 2 + m % 2;
  for (int a = 1; a <= N; a++) {
    cout << m << endl;
    cin >> p[a];
    if (p[a] == 0) {
      return 0;
    }
  }
  for (int a = 0; a < 60 - N; a++) {
    i++;
    cout << x << endl;
    cin >> ats;
    ats = ats * p[i];
    if (ats == 0) {
      return 0;
    }
    if (ats == -1) {
      binary = binary / 2 + binary % 2;
      x = min(x + binary, m);
    } else if (ats == 1) {
      binary = binary / 2 + binary % 2;
      x = max(x - binary, t);
    } else {
      return 1;
    }
    if (i == N) {
      i = 0;
    }
  }
  return 0;
}
