#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 2e5 + 100;
vector<int> v;
map<int, int> mp;
int n, k, b[N], a[N], f[N], num[N];
int m;
bool did[N], flag[N];
string s;
int s1, s2, cnt = 0, ans, tot, t;
const int mod = 1e9 + 7;
int main() {
  int x;
  scanf("%d%d", &m, &n);
  for (int i = 0; i < n; i++) {
    printf("%d\n", 1);
    fflush(stdout);
    scanf("%d", &x);
    if (x == 0)
      return 0;
    else if (x > 0)
      flag[i] = true;
    else
      flag[i] = false;
  }
  int l = 1, mid, r = m, dex = 0;
  while (l <= r) {
    mid = (l + r) >> 1;
    printf("%d\n", mid);
    fflush(stdout);
    scanf("%d", &x);
    if (x == 0)
      return 0;
    else if (flag[dex]) {
      if (x == 1)
        l = mid + 1;
      else
        r = mid - 1;
    } else {
      if (x == 1)
        r = mid - 1;
      else
        l = mid + 1;
    }
    dex++;
    if (dex == n) dex = 0;
  }
  return 0;
}
