#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long INF = 4e18 + 10;
long long power(long long a, long long b, long long in_mod) {
  long long ans = 1;
  long long prod = a;
  while (b) {
    if (b % 2) ans = (ans * prod) % in_mod;
    prod = (prod * prod) % in_mod;
    b /= 2;
  }
  return ans;
}
long long mod_inv(long long q, long long in_mod) {
  return power(q, in_mod - 2, in_mod);
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long fact(long long n, long long in_mod) {
  long long f = 1;
  for (long long i = 1; i <= n; i++) f = (f * i) % in_mod;
  return f;
}
long long ncr(long long n, long long r, long long in_mod) {
  return (((fact(n, in_mod) * mod_inv(fact(r, in_mod), in_mod)) % in_mod) *
          mod_inv(fact(n - r, in_mod), in_mod)) %
         in_mod;
}
void solve() {
  long long m, n;
  cin >> m >> n;
  long long p[n];
  for (long long i = 0; i < n; i++) {
    cout << 1 << '\n' << flush;
    long long ip;
    cin >> ip;
    if (ip == 0) {
      return;
    }
    if (ip == 1) {
      p[i] = 1;
    } else
      p[i] = 0;
  }
  long long st = n;
  long long l = 1;
  long long r = m;
  while (l < r) {
    long long y = (l + r) / 2;
    cout << y << '\n' << flush;
    long long ip;
    cin >> ip;
    if (ip == 0) {
      return;
    }
    if (p[st % n] == 1) {
      if (ip == 1)
        l = y + 1;
      else
        r = y;
    } else {
      if (ip == -1)
        l = y + 1;
      else
        r = y;
    }
    st++;
  }
  cout << l << '\n' << flush;
  long long ip;
  cin >> ip;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << fixed << setprecision(10);
  auto clk = clock();
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  long long t = 1;
  for (long long test = 1; test <= t; test++) {
    solve();
  }
  clk = clock() - clk;
  cerr << fixed << setprecision(6)
       << "Time: " << ((long double)clk) / CLOCKS_PER_SEC << "\n";
  return 0;
}
