#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e18;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int nax = 1000000 + 10;
int n, arr[nax];
void print(int num) { exit(0); }
int main() {
  ios::sync_with_stdio(0);
  int m, n;
  cin >> m >> n;
  if (m <= 60) {
    for (int i = 1; i <= m; i++) {
      cout << i << "\n";
      fflush(stdout);
      int num;
      cin >> num;
      if (num == 0) print(i);
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << 1 << "\n";
    fflush(stdout);
    int num;
    cin >> num;
    if (num == 0) {
      print(1);
    }
    if (num == 1)
      arr[i] = 1;
    else
      arr[i] = 0;
  }
  int l = 1, r = m;
  int iter = 1;
  while (r - l > 1) {
    int mid = (r + l) / 2;
    cout << mid << "\n";
    fflush(stdout);
    int num;
    cin >> num;
    if (num == 0) {
      print(num);
    }
    if (arr[iter] == 1) {
      if (num == -1)
        r = mid - 1;
      else
        l = mid + 1;
    }
    if (arr[iter] == 0) {
      if (num == -1)
        l = mid + 1;
      else
        r = mid - 1;
    }
    iter++;
    if (iter == n + 1) iter = 1;
  }
  cout << l << "\n";
  fflush(stdout);
  int num;
  cin >> num;
  if (num == 0) {
    print(l);
  }
  cout << r << "\n";
  fflush(stdout);
  cin >> num;
  print(r);
  return 0;
}
