#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using iii = pair<int, ii>;
const int MOD = 1e9 + 7;
const int INF = 2e9;
const int N = 65;
int m, n;
int p[N];
int ask(int x) {
  cout << x << endl << flush;
  int ret;
  cin >> ret;
  return ret;
}
void getPermutation() {
  for (int i = 1, resp; i <= n; i++) {
    resp = ask(1);
    if (!resp) exit(0);
    p[i] = (resp == 1 ? 1 : 0);
  }
  for (int i = n + 1; i <= 60; i++) {
    p[i] = p[i - n];
  }
}
void binser(int l, int r) {
  int mid, ans, now = 1;
  while (l <= r) {
    mid = (l + r) / 2;
    ans = ask(mid);
    if (!ans)
      exit(0);
    else if (p[now] == 1) {
      if (ans == 1)
        l = mid + 1;
      else
        r = mid - 1;
    } else {
      if (ans == 1)
        r = mid - 1;
      else
        l = mid + 1;
    }
    now++;
  }
}
void solve() {
  int T = 1;
  while (T--) {
    cin >> m >> n;
    getPermutation();
    binser(1, m);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
