#include <bits/stdc++.h>
using namespace std;
int lie[40];
int main() {
  int m, n;
  cin >> m >> n;
  for (int i = 1; i <= n; i++) {
    cout << 1 << endl;
    fflush(stdout);
    int res;
    cin >> res;
    if (res == 0) {
      puts("1");
      return 0;
    }
    if (res == -1) lie[i] = 1;
  }
  int l = 1, r = m;
  int tmp = 0;
  while (1) {
    tmp %= n;
    tmp++;
    long long mid = (1LL * l + r) / 2;
    cout << mid << endl;
    fflush(stdout);
    int res;
    cin >> res;
    if (lie[tmp]) res = -res;
    if (res == 0) {
      printf("%d\n", mid);
      return 0;
    }
    if (res == 1)
      l = mid + 1;
    else
      r = mid - 1;
  }
}
