#include <bits/stdc++.h>
using namespace std;
const long double Pi = 3.14159265, eps = 1e-6;
const int oo = 1e9, Mod = 1e9 + 7;
const long long ool = 1e18;
int const N = 2e5 + 10;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int m, n;
  cin >> m >> n;
  int ste[n];
  for (int i = 0; i < n; i++) {
    cout << 1 << endl;
    int y;
    cin >> y;
    if (!y) return 0;
    ste[i] = y;
  }
  int low = 1, hig = m + 1;
  int j = -1;
  while (hig > low + 1) {
    int mid = (hig + low) / 2;
    cout << mid << endl;
    int y;
    cin >> y;
    if (!y) return 0;
    j++;
    j %= n;
    y *= ste[j];
    if (y == 1) {
      low = mid;
      continue;
    }
    hig = mid;
  }
}
