#include <bits/stdc++.h>
using namespace std;
const int N = 60 + 2, M = 1e9;
int m, n, ar[N];
int main() {
  fill(ar, ar + N, 1);
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    cout << m << endl;
    int x;
    cin >> x;
    if (!x || x == -2) exit(0);
    ar[i] = x;
  }
  int st = 0, ed = m, u = 0;
  while (ed - st > 1) {
    int mid = (st + ed) / 2;
    cout << mid << endl;
    int x;
    cin >> x;
    if (!x || x == -2) exit(0);
    if (ar[u] == -1) {
      if (x == -1)
        ed = mid;
      else
        st = mid;
    } else {
      if (x == 1)
        ed = mid;
      else
        st = mid;
    }
    u++;
    u %= n;
  }
  cout << st << endl;
  int x;
  cin >> x;
  return 0;
}
