#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1000000007;
const int N = 200000 + 7;
int n, m;
int fa[32];
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> m >> n;
  for (int i = 1; i <= n; i++) {
    cout << 1 << endl;
    fflush(stdout);
    int a;
    cin >> a;
    if (a == 0) {
      return 0;
    } else if (a == -1)
      fa[i] = -1;
    else
      fa[i] = 1;
  }
  int low = 1, high = m;
  int c = 1;
  while (low < high) {
    int mid = (low + high) / 2;
    cout << mid << endl;
    fflush(stdout);
    int a;
    cin >> a;
    if (a == 0) {
      return 0;
    } else {
      a = fa[c] * a;
      if (a == -1) {
        high = mid - 1;
      } else
        low = mid + 1;
    }
    c++;
    if (c == n + 1) c = 1;
  }
  cout << low << endl;
  fflush(stdout);
  int a;
  cin >> a;
  return 0;
}
