#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:167772160")
using namespace std;
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
using dbl = double;
const int INF = (int)1e9 + 10;
const ll LINF = ll(2e18) + 10;
const double PI = acosl(-1);
const double eps = 1e-8;
const int N = 31;
int type[N];
void solve() {
  int m, n;
  cin >> m >> n;
  for (int i = 0; i < n; ++i) {
    cout << 1 << endl;
    int ans;
    cin >> ans;
    if (ans == 0) return;
    if (ans == 1) type[i] = 1;
  }
  int l = 1;
  int r = m + 1;
  int id = 0;
  while (r - l > 1) {
    auto mid = (l + r) / 2;
    cout << mid << endl;
    int ans;
    cin >> ans;
    if (ans == 0) return;
    if (type[id % n] == 0) ans = -ans;
    ++id;
    if (ans == -1)
      r = mid;
    else
      l = mid;
  }
  throw;
}
int main() {
  solve();
  (void)0;
}
