#include <bits/stdc++.h>
using namespace std;
int check(int n) {
  cout << n << endl;
  fflush(stdout);
  int x;
  cin >> x;
  if (x == 0) exit(0);
  return x;
}
const int maxn = 1e6 + 10;
bool xxx[maxn];
int n, m;
vector<int> vec;
void solve() {
  int xx;
  int left = 1, right = m - 1, pos = 0;
  while (left < right) {
    int mid = left + (right - left) / 2;
    cout << mid << endl;
    cin >> xx;
    if (xx == 0 || xx == -2) exit(0);
    if (vec[pos]) xx *= -1;
    if (xx == 1)
      left = mid + 1;
    else
      right = mid - 1;
    pos = (pos + 1) % n;
  }
  cout << left << endl;
  cin >> xx;
  if (xx == 0 || xx == -2) exit(0);
  cout << right << endl;
}
int main(void) {
  int xx;
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    cout << m << endl;
    cin >> xx;
    if (xx == 0 || xx == -2) {
      return 0;
    }
    if (xx == 1) {
      vec.push_back(1);
    } else {
      vec.push_back(0);
    }
  }
  solve();
  return 0;
}
