#include <bits/stdc++.h>
using namespace std;
const int N = 205000;
const int mod = 1e9 + 7;
const long long inf = 1e18;
int m, n;
inline int ask(int x) {
  cout << x << endl;
  cin >> x;
  if (x == 0) exit(0);
  return x;
}
int wrong[100];
int main() {
  cin >> m >> n;
  for (int i = 1; i <= n; ++i) {
    int res = ask(1);
    if (res == -1) wrong[i] = 1;
  }
  int l = 1, r = m;
  int q = 1;
  while (l < r) {
    int m = (l + r) >> 1;
    int res = ask(m);
    if (wrong[q]) res *= -1;
    if (res == -1)
      r = m - 1;
    else
      l = m + 1;
    q = (q + 1);
    if (q > n) q -= n;
  }
  ask(l);
  return 0;
}
