#include <bits/stdc++.h>
using namespace std;
int n, m, p[100];
int query(int x) {
  cout << x << endl;
  fflush(stdout);
  int now;
  cin >> now;
  if (now && now != -2)
    return now;
  else
    exit(0);
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    int x = query(1);
    p[i] = (x == 1);
  }
  int lo = 1, hi = m, pos = 0;
  while (true) {
    int mid = lo + (hi - lo) / 2;
    int x = query(mid);
    if (!p[pos]) x *= -1;
    if (x == 1)
      lo = mid + 1;
    else
      hi = mid - 1;
    pos++;
    pos %= n;
  }
  return 0;
}
