#include <bits/stdc++.h>
using namespace std;
long long n, res, temp, t1, t2, t3, ok, x[100], l, r, mm;
string str;
char ch;
double ans, m;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> m >> n;
  for (long long i = 0; i < n; i++) {
    cout << "1";
    cout << endl;
    fflush(stdout);
    cin >> temp;
    if (temp == 0) return 0;
    x[i] = temp;
  }
  l = 1;
  r = m + 1;
  for (long long i = 0; i < 60 - n; i++) {
    mm = (l + r) / 2;
    cout << mm << endl;
    fflush(stdout);
    cin >> temp;
    temp *= x[i % n];
    if (temp == 0) return 0;
    if (temp == -1) r = mm;
    if (temp == 1) l = mm;
  }
}
