#include <bits/stdc++.h>
using namespace std;
bool a[32];
int main() {
  int n, m, x;
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    cout << 1 << ' ';
    cin >> x;
    if (x == 0) {
      cout << 1;
      return 0;
    } else if (x == 1)
      a[i] = 1;
    else
      a[i] = 0;
  }
  int l = 0, r = m + 1, mid, mod = 0;
  while (r - l > 1) {
    mid = (l + r) / 2;
    cout << mid << endl;
    cin >> x;
    if (x == 0)
      return 0;
    else if (!a[mod])
      x *= -1;
    if (x == -1)
      r = mid;
    else
      l = mid;
    mod++;
    mod = mod % n;
  }
  if (r - l == 1) {
    cout << l << ' ';
    cin >> x;
    if (x == 0) return 0;
    cout << r;
    return 0;
  }
}
