#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <class T>
using vv = vector<vector<T>>;
template <class T>
inline bool MX(T &l, const T &r) {
  return l < r ? l = r, 1 : 0;
}
template <class T>
inline bool MN(T &l, const T &r) {
  return l > r ? l = r, 1 : 0;
}
const ll MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(0);
  int ub, n;
  cin >> ub >> n;
  vector<int> correct(n);
  for (int(i) = 0; (i) < (n); ++(i)) {
    cout << 1 << endl;
    cout.flush();
    int t;
    cin >> t;
    if (!t) exit(0);
    if (t == 1) correct[i] = 1;
  }
  int l = 2, r = ub;
  for (int i = 0; r - l > 1; ++i) {
    ;
    int m = (l + r) / 2;
    cout << m << endl;
    cout.flush();
    int t;
    cin >> t;
    if (!t) exit(0);
    if (!correct[i % n]) t = -t;
    if (t == -1)
      r = m - 1;
    else
      l = m + 1;
  }
  for (int(i) = (r + 1) - 1; (i) >= (l); --(i)) {
    cout << i << endl;
    cout.flush();
    int t;
    cin >> t;
    if (!t) exit(0);
  }
  return 0;
}
