#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.141592653589793238462643383;
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int Ceil(long long int a, long long int b) {
  if (a % b == 0)
    return a / b;
  else
    return a / b + 1;
}
const int MAX = 3009;
const int MOD = 1e9 + 7;
const int inf = 1e9 + 10;
int p[50];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int m, n;
  cin >> m >> n;
  fflush(stdout);
  int x;
  for (int i = 0; i < (n); ++i) {
    cout << m << endl;
    fflush(stdout);
    cin >> x;
    if (x == 0)
      return 0;
    else if (x == -1)
      p[i] = 1;
    else if (x == 1)
      p[i] = -1;
    else
      return 0;
  }
  long long int l = 1, r = m;
  int i = 0;
  while (l < r) {
    long long int ii = (l + r) / 2;
    cout << ii << endl;
    fflush(stdout);
    cin >> x;
    if (x == 0)
      return 0;
    else if (x * p[i] == -1)
      r = ii - 1;
    else if (x * p[i] == 1)
      l = ii + 1;
    else
      return 0;
    i = (i + 1) % n;
  }
  cout << l << endl;
  fflush(stdout);
  cin >> x;
  if (x == 0)
    return 0;
  else
    return 0;
  return 0;
}
