#include <bits/stdc++.h>
using namespace std;
int m, n, ans[30];
int Ask(int x) {
  cout << x << '\n' << flush;
  int res;
  cin >> res;
  if (res == 0 || res == -2) exit(0);
  return res;
}
int main() {
  cin >> m >> n;
  for (int i = 0; i < n; ++i) ans[i] = Ask(1);
  int l = 2, r = m;
  for (int i = 0; l <= r; ++i) {
    int mid = (l + r) / 2;
    int val = Ask(mid);
    if (val == ans[i % n])
      l = mid + 1;
    else
      r = mid - 1;
  }
  return 0;
}
