#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
long long int inverse(long long int i) {
  if (i == 1) return 1;
  return (MOD - ((MOD / i) * inverse(MOD % i)) % MOD + MOD) % MOD;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long m, n, x;
  cin >> m >> n;
  cout << flush;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cout << 1 << endl;
    cout << flush;
    cin >> x;
    if (x == 0)
      exit(0);
    else if (x == 1)
      a[i] = 1;
    else
      a[i] = 0;
  }
  long long l = 2, r = m, mid, j = 0;
  while (1) {
    mid = (l + r) / 2;
    cout << mid << endl;
    cout << flush;
    cin >> x;
    if (x == 0 || x == -2)
      exit(0);
    else {
      if (x == 1) {
        if (a[j] == 1)
          l = mid + 1;
        else
          r = mid - 1;
      } else if (x == -1) {
        if (a[j] == 1)
          r = mid - 1;
        else
          l = mid + 1;
      }
    }
    j++;
    j %= n;
  }
}
