#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const int maxn = 1000005;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int a[105], vis[105], num[105];
double land[1005], fly[1005];
int main() {
  int n, m;
  cin >> n >> m;
  int ans = (1 + n) / 2;
  int l = 1, r = n;
  for (int i = 0; i < m; i++) {
    cout << 1 << endl;
    cin >> a[i];
    if (a[i] == 0) {
      exit(0);
    }
  }
  cout << ans << endl;
  int cnt = 0;
  while (true) {
    int x;
    cin >> x;
    if (x == 0 || x == -2) {
      exit(0);
    }
    if (a[cnt % m] * x == -1) {
      r = ans - 1;
      ans = (l + r) / 2;
    } else {
      l = ans + 1;
      ans = (l + r) / 2;
    }
    cnt++;
    cout << ans << endl;
  }
}
