#include <bits/stdc++.h>
template <typename T>
inline T const &MAX(T const &a, T const &b) {
  return a > b ? a : b;
}
template <typename T>
inline T const &MIN(T const &a, T const &b) {
  return a < b ? a : b;
}
inline void add(long long &a, long long b) {
  a += b;
  if (a >= 1000000007) a -= 1000000007;
}
inline void sub(long long &a, long long b) {
  a -= b;
  if (a < 0) a += 1000000007;
}
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline long long qp(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % 1000000007;
    a = a * a % 1000000007, b >>= 1;
  }
  return ans;
}
inline long long qp(long long a, long long b, long long c) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % c;
    a = a * a % c, b >>= 1;
  }
  return ans;
}
using namespace std;
const double eps = 1e-8;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int N = 100000 + 10, maxn = 50000 + 10, inf = 0x3f3f3f3f;
int a[N];
int main() {
  int m, n;
  scanf("%d%d", &m, &n);
  for (int i = 1; i <= n; i++) {
    puts("1");
    fflush(stdout);
    scanf("%d", &a[i]);
    if (!i[a]) return 0;
    a[i] = -a[i];
  }
  int l = 0, r = m + 1, now = 1;
  while (l < r - 1) {
    int m = (l + r) >> 1;
    printf("%d\n", m);
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x *= a[now];
    now++;
    if (now > n) now = 1;
    if (x == 1)
      r = m;
    else if (x == -1)
      l = m;
    else
      return 0;
  }
  return 0;
}
