#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
const int infinity = (int)1e9 + 42;
const int64_t llInfinity = (int64_t)1e18 + 256;
const int module = (int)1e9 + 7;
const long double eps = 1e-8;
mt19937_64 randGen(system_clock().now().time_since_epoch().count());
inline void raiseError(string errorCode) {
  cerr << "Error : " << errorCode << endl;
  exit(42);
}
inline int readAns(int req) {
  cout << req << endl;
  int q;
  cin >> q;
  if (q == 0) {
    exit(0);
  }
  return q;
}
signed main() {
  ios_base::sync_with_stdio(false);
  int m, n;
  cin >> m >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    v[i] = readAns(m) * -1;
  }
  int l = 1, r = m - 1;
  int p = 0;
  while (l != r) {
    int m = (l + r) / 2;
    int ans = readAns(m) * v[p];
    p++;
    p %= n;
    if (ans < 0) {
      r = m - 1;
    } else {
      l = m + 1;
    }
  }
  readAns(l);
  assert(false);
  return 0;
}
