#include <bits/stdc++.h>
using namespace std;
const int mm = 2e5 + 20;
const long long mol = 998244353;
const long long inf = 1e13;
long long m, n, inp;
bool tr[40];
void bs() {
  long long l = 1, r = m + 1, i = 0;
  while (r - l > 1) {
    long long mid = (l + r) / 2;
    cout << mid << endl;
    cin >> inp;
    if (inp == 0)
      return;
    else if (inp == -1 && tr[i])
      r = mid;
    else if (inp == -1 && !tr[i])
      l = mid;
    else if (inp == 1 && tr[i])
      l = mid;
    else if (inp == 1 && !tr[i])
      r = mid;
    i++;
    if (i == n) i = 0;
  }
}
int main() {
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    cout << 1 << endl;
    cin >> inp;
    if (inp == 1)
      tr[i] = 1;
    else if (inp == -1)
      tr[i] = 0;
    else
      return 0;
  }
  bs();
}
