#include <bits/stdc++.h>
const long long MOD = 1e9 + 7;
const long long MOD2 = 998244353;
const long long inf = 1e18;
using namespace std;
const int N = 1e6 + 1;
int query(int y) {
  cout << y << "\n";
  fflush(stdout);
  int t;
  cin >> t;
  if (t == 0 || t == -2) exit(0);
  return t;
}
void solve() {}
int main() {
  int m, n;
  cin >> m >> n;
  vector<int> Ans(n);
  for (long long i = 0; i < n; i++) {
    cout << 1 << "\n";
    fflush(stdout);
    cin >> Ans[i];
    if (Ans[i] == 0) {
      exit(0);
    }
  }
  int st = 1, en = m + 1, j = 0;
  for (long long i = 0; i < 30; i++) {
    int mid = (st + en) / 2;
    cout << mid << "\n";
    fflush(stdout);
    int y;
    cin >> y;
    if (Ans[j] == 1) {
      if (y == 1) {
        st = mid;
      } else if (y == -1) {
        en = mid;
      } else {
        exit(0);
      }
    } else {
      if (y == 1) {
        en = mid;
      } else if (y == -1) {
        st = mid;
      } else {
        exit(0);
      }
    }
    j++;
    j %= n;
  }
}
