#include <bits/stdc++.h>
using namespace std;
int n;
int m;
int p[1000000];
int cur = 0;
int check(int mid) {
  cout << mid << endl;
  fflush(stdout);
  int x;
  cin >> x;
  cur %= n;
  if (p[cur++])
    return x;
  else
    return -x;
}
void bs(int l, int r) {
  while (l <= r) {
    int mid = (l + r) / 2;
    int x = check(mid);
    if (x == 0) {
      return;
    } else if (x == 1) {
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
}
int main() {
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    cout << 1 << endl;
    fflush(stdout);
    int x;
    cin >> x;
    if (x == 0) return 0;
    if (x == 1) {
      p[i] = 1;
    } else
      p[i] = 0;
  }
  bs(1, m);
}
