#include <bits/stdc++.h>
using namespace std;
long long mod = (long long)1 << 50;
long long QPow(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    if (b & 1) ans = ans % mod * a % mod;
    a = a % mod * a % mod;
    b >>= 1;
  }
  return ans;
}
long long gcd(long long x, long long y) {
  if (x == 1 || y == 1)
    return 1;
  else {
    if (x == 0) return y;
    if (y == 0) return x;
    if (x % y == 0) return y;
    if (y % x == 0) return x;
    if (x > y)
      return gcd(x % y, y);
    else
      return gcd(x, y % x);
  }
}
string toString(long long a) {
  if (a == 0) return "0";
  string temp = "";
  if (a < 0) temp.push_back('-');
  long long tp = a;
  while (tp) {
    temp.push_back('0' + tp % 10);
    tp /= 10;
  }
  string temp2 = temp;
  for (int ii = 0; ii < temp.size(); ii++) {
    temp[ii] = temp2[temp.size() - 1 - ii];
  }
  return temp;
}
long long inf = INT_MAX;
const int maxn = 1e2 + 5;
int cnt = 0;
int head[maxn], dep[maxn], fa[maxn][22];
long long dis[maxn];
struct edge {
  int v, nx;
  long long val;
} es[maxn << 1];
void add(int u, int v, int w) {
  es[cnt].v = v;
  es[cnt].nx = head[u];
  es[cnt].val = w;
  head[u] = cnt++;
}
void dfs0(int u, int f, long long ds) {
  dis[u] = ds;
  for (int i = head[u]; i != -1; i = es[i].nx) {
    int v = es[i].v;
    if (v == f) continue;
    dfs0(v, u, ds + es[i].val);
  }
}
void dfs(int u, int f) {
  dep[u] = dep[f] + 1;
  fa[u][0] = f;
  for (int i = 1; (1 << i) <= dep[u]; i++) {
    fa[u][i] = fa[fa[u][i - 1]][i - 1];
  }
  for (int i = head[u]; i != -1; i = es[i].nx) {
    int v = es[i].v;
    if (v != f) dfs(v, u);
  }
}
int lca(int a, int b) {
  if (dep[a] > dep[b]) swap(a, b);
  for (int i = 20; i >= 0; i--)
    if (dep[a] <= dep[b] - (1 << i)) b = fa[b][i];
  if (a == b) return a;
  for (int i = 20; i >= 0; i--) {
    if (fa[a][i] == fa[b][i])
      continue;
    else
      a = fa[a][i], b = fa[b][i];
  }
  return fa[a][0];
}
int pp[62];
int answ[62];
long long m, n;
int cur;
void solve(int l, int r) {
  int md = (l + r) >> 1;
  int as;
  cout << md << endl;
  cout.flush();
  cin >> as;
  cur++;
  if (as == 1) {
    if (pp[(cur - 2) % n + 1])
      solve(md + 1, r);
    else
      solve(l, md);
  } else if (as == -1) {
    if (pp[(cur - 2) % n + 1])
      solve(l, md);
    else
      solve(md + 1, r);
  } else
    exit(0);
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ifstream in("Text.txt");
  cin >> m >> n;
  int as = 0;
  for (int i = 1; i <= n; i++) {
    cout << 1 << endl;
    cout.flush();
    cin >> as;
    if (as == 0)
      exit(0);
    else if (as == 1)
      pp[i] = 1;
    else
      pp[i] = 0;
  }
  cur = 1;
  solve(1, m);
  return 0;
}
