#include <bits/stdc++.h>
using namespace std;
long long nMod = 1e9 + 7;
inline long long GCD(long long a, long long b) {
  while (b != 0) {
    long long c = a % b;
    a = b;
    b = c;
  }
  return a;
};
inline long long LCM(long long a, long long b) { return (a / GCD(a, b)) * b; };
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  int m, n;
  cin >> m >> n;
  vector<int> arr(n);
  for (int i = (0); i < (n); i++) {
    cout << 1 << endl;
    fflush(stdout);
    int ans;
    cin >> ans;
    if (ans == 0) {
      return 0;
    } else {
      if (ans == -1) {
        arr[i] = 0;
      } else {
        arr[i] = 1;
      }
    }
  }
  int low = 1, high = m;
  int i = 0;
  while (true) {
    int m = (low + high) / 2;
    cout << m << endl;
    fflush(stdout);
    int ans;
    cin >> ans;
    if (ans == 0 || ans == -2) {
      return 0;
    } else {
      if (arr[i]) {
        if (ans == -1) {
          high = m - 1;
        } else {
          low = m + 1;
        }
      } else {
        if (ans == -1) {
          low = m + 1;
        } else {
          high = m - 1;
        }
      }
    }
    i = (i + 1) % n;
  }
  return 0;
}
