#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int a[200];
int main() {
  int x, m, n;
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    cout << 1 << endl;
    cin >> x;
    if (x == 0) return 0;
    a[i] = x;
  }
  int l = 1, r = m;
  for (int i = 0; i < 300; i++) {
    long long mid = l + r >> 1;
    cout << mid << endl;
    cin >> x;
    if (x == 0) return 0;
    if (x * a[i % n] == 1)
      l = mid + 1;
    else
      r = mid;
  }
  return 0;
}
