#include <bits/stdc++.h>
using namespace std;
const long double EPS = (long double)1e-9;
const long double PI = acos(0) * 2;
bool isZero(const long double& x) { return abs(x) <= EPS; }
int sign(const long double& x) { return isZero(x) ? 0 : (0 < x ? 1 : -1); }
long long gcd(long long a, long long b) {
  for (; b; a %= b, swap(a, b)) {
  }
  return abs(a);
}
pair<long long, long long> operator+(const pair<long long, long long>& a,
                                     const pair<long long, long long>& b) {
  return pair<long long, long long>(a.first + b.first, a.second + b.second);
}
pair<long long, long long> operator-(const pair<long long, long long>& a,
                                     const pair<long long, long long>& b) {
  return pair<long long, long long>(a.first - b.first, a.second - b.second);
}
pair<long long, long long> operator*(const pair<long long, long long>& a,
                                     const long long& b) {
  return pair<long long, long long>(a.first * b, a.second * b);
}
long long operator*(const pair<long long, long long>& a,
                    const pair<long long, long long>& b) {
  return a.first * b.second - b.first * a.second;
}
long long ccw(const pair<long long, long long>& a,
              const pair<long long, long long>& b,
              const pair<long long, long long>& c) {
  return a * b + b * c + c * a;
}
void fg(vector<int> G[], int a, int b) {
  G[a].push_back(b);
  G[b].push_back(a);
}
void fg(vector<pair<int, int> > G[], int a, int b, int c) {
  G[a].push_back({b, c});
  G[b].push_back({a, c});
}
int A[66];
int M, N;
int main() {
  cin >> M >> N;
  for (int i = 0; i < N; i++) {
    puts("1");
    fflush(stdout);
    scanf("%d", &A[i]);
    if (!A[i]) return 0;
  }
  {
    int cnt = 0;
    int s = 1, e = M;
    for (int m; s < e;) {
      m = (s + e) / 2;
      printf("%d\n", m);
      fflush(stdout);
      int t;
      scanf("%d", &t);
      if (!t) return 0;
      if (A[cnt % N] < 0) t = -t;
      if (0 < t)
        s = m + 1;
      else
        e = m - 1;
      cnt++;
    }
    printf("%d\n", s);
  }
  return 0;
}
