#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int dx[] = {0, 1, 0, -1, 1, -1, -1, 1};
int dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
bool check(int i, int j, int n, int m) {
  return (i >= 0 && j >= 0 && i < n && j < m);
}
string tol(string &a) {
  for (int i = 0; i < a.length(); i++) {
    if (a[i] >= 'A' && a[i] <= 'Z') a[i] = a[i] + 32;
  }
  return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  long m;
  cin >> m >> n;
  int cnt = 60;
  vector<int> seq(n, 0);
  for (int i = 0; i < n; i++) {
    cout << 1 << endl;
    fflush(stdout);
    cin >> seq[i];
    cnt--;
    if (seq[i] == 0)
      return 0;
    else if (seq[i] < 0)
      seq[i] = 0;
  }
  long second = 1, e = m;
  int ind = 0;
  while (second <= e) {
    long mid = (second + e) >> 1;
    cout << mid << endl;
    fflush(stdout);
    int x;
    cin >> x;
    if (x == 0) return 0;
    if (seq[ind] == 1) {
      if (x > 0)
        second = mid + 1;
      else
        e = mid - 1;
    } else {
      if (x > 0)
        e = mid - 1;
      else
        second = mid + 1;
    }
    ind = (ind + 1) % n;
    cnt--;
  }
  return 0;
}
