#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
long long int m, n;
int b[1000000];
int cntr;
void bin(long long int s, long long int e) {
  int mid = (s + e) / 2;
  cout << mid << endl;
  fflush(stdout);
  int t;
  cin >> t;
  if (t == 0) exit(0);
  if (t == -2) exit(0);
  if (s == e) assert(1 < 0);
  if (t * b[cntr] < 0) {
    cntr++;
    cntr %= n;
    bin(s, mid - 1);
  } else {
    cntr++;
    cntr %= n;
    bin(mid + 1, e);
  }
}
int main() {
  cin >> m >> n;
  cout << m << endl;
  fflush(stdout);
  int ret;
  cin >> ret;
  if (ret == 0) exit(0);
  b[0] = ret;
  for (int i = 1; i < n; i++) {
    cout << m << endl;
    fflush(stdout);
    cin >> ret;
    b[i] = ret;
    if (ret == -2) exit(0);
  }
  for (int i = 0; i < n; i++) {
    b[i] = -b[i];
  }
  cntr = 0;
  bin(1, m);
}
