#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int tcs = 1, T;
  T = 1;
  while ((tcs++) <= T) {
    int m, n;
    cin >> m >> n;
    int ar[n];
    for (int i = 0; i < n; i++) {
      cout << 1 << endl;
      cout.flush();
      int inp;
      cin >> inp;
      if (inp == 0) return 0;
      ar[i] = inp;
    }
    int low = 1, high = m;
    int mid, i = 0;
    while (low <= high) {
      mid = low + ((high - low) / 2);
      cout << mid << endl;
      cout.flush();
      int inp;
      cin >> inp;
      if (inp == 0) return 0;
      inp *= ar[i];
      if (inp == 1)
        low = mid + 1;
      else
        high = mid - 1;
      i++;
      i %= n;
    }
  }
  return 0;
}
