#include <bits/stdc++.h>
using namespace std;
const int maxm = 35;
int p[maxm];
signed main() {
  int m, n;
  cin >> m >> n;
  int x;
  for (int i = 0; i < n; i++) {
    cout << 1 << endl;
    cin >> x;
    if (x == 1)
      p[i] = 1;
    else
      p[i] = 0;
  }
  int l = 2, r = m;
  int now = 0;
  while (x != 0) {
    int mid = (l + r) / 2;
    cout << mid << endl;
    cin >> x;
    if (!p[now++]) x = -x;
    now %= n;
    if (x == 1)
      l = mid + 1;
    else
      r = mid - 1;
  }
  return 0;
}
