#include <bits/stdc++.h>
const long long mod = 1000 * 1000 * 1000 + 7;
const long long mod1 = 998244353;
const long long INF = 1ll * 1000 * 1000 * 1000 * 1000 * 1000 * 1000 + 7;
using namespace std;
long long power(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = (long long)(res * x);
    y = y >> 1;
    x = (long long)(x * x);
  }
  return res;
}
template <typename T>
T MIN(T first) {
  return first;
}
template <typename T, typename... Args>
T MIN(T first, Args... args) {
  return min(first, MIN(args...));
}
template <typename T>
T MAX(T first) {
  return first;
}
template <typename T, typename... Args>
T MAX(T first, Args... args) {
  return max(first, MAX(args...));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> m >> n;
  vector<long long> truths(n);
  cout << 1 << "\n";
  cout << flush;
  long long val;
  cin >> val;
  if (val == 0) {
    cout << flush;
    return 0;
  } else {
    if (val == 1)
      truths[0] = 1;
    else
      truths[0] = 0;
    for (int(i) = (1); (i) < (n); ++(i)) {
      cout << 1 << "\n";
      cout << flush;
      cin >> val;
      if (val == 1)
        truths[i] = 1;
      else
        truths[i] = 0;
    }
    long long cnt = 0;
    long long l = 1;
    long long r = m;
    while (l < r) {
      long long mid = (l + r) / 2;
      cout << mid << "\n";
      cout << flush;
      cin >> val;
      if (val == 0) {
        cout << flush;
        return 0;
      } else {
        if (truths[cnt] == 0) val *= -1;
        if (val == 1) {
          l = mid + 1;
        } else {
          r = mid;
        }
        cnt += 1;
        cnt %= n;
      }
    }
    cout << l << "\n";
    cout << flush;
  }
  return 0;
}
