#include <bits/stdc++.h>
using namespace std;
int m, n;
int res[30];
int getResponse(int v) {
  cout << v << endl;
  fflush(stdout);
  int response;
  cin >> response;
  if (response == 0) exit(0);
  if (response == -2) exit(0);
  return response;
}
int getCorrectedResponse(int v) {
  static int iteration = 0;
  int response = getResponse(v) * res[iteration];
  iteration++;
  iteration %= n;
  return response;
}
int main() {
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    res[i] = getResponse(1);
  }
  int left = 1, right = m;
  while (true) {
    int mid = (left + right) / 2;
    if (getCorrectedResponse(mid) > 0)
      left = mid + 1;
    else
      right = mid - 1;
  }
  return 0;
}
