#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
const int INF = 2e9 + 179, MOD = 1e9 + 7;
const long long int BIGINF = 2e18 + 179;
const long double EPS = 0.000001;
using namespace std;
int m, n;
int solve() {
  cin >> m >> n;
  vector<int> p(n);
  cout << 1 << endl;
  int x;
  cin >> x;
  if (x == 0) {
    exit(0);
  }
  if (x == -1) {
    p[0] = 0;
  } else {
    p[0] = 1;
  }
  for (int i = 1; i < n; ++i) {
    cout << 1 << endl;
    cin >> x;
    if (x == 0) {
      exit(0);
    }
    if (x == -1) {
      p[i] = 0;
    } else {
      p[i] = 1;
    }
  }
  int now = 0;
  int l = 1, r = m + 1, mid;
  while (r - l > 1) {
    mid = (l + r) >> 1;
    cout << mid << endl;
    cin >> x;
    if (x == 0) {
      exit(0);
    }
    if (!p[now]) {
      x = -x;
    }
    if (x > 0) {
      l = mid;
    } else {
      r = mid;
    }
    now++;
    now %= n;
  }
  cout << r << endl;
  cin >> x;
  if (x == 0) {
    exit(0);
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << fixed << setprecision(20);
  solve();
  return 0;
}
