#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
char CRTBUFF[30000];
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
const double EPS = 1e-9;
const int INF = 0x3f3f3f3f;
const double PI = 2.0 * acos(0.0);
long long MIN() { return INF; }
template <typename T, typename... Args>
inline T MIN(T a, Args... args) {
  return min(a, (T)MIN(args...));
}
long long MAX() { return -INF; }
template <typename T, typename... Args>
inline T MAX(T a, Args... args) {
  return max(a, (T)MAX(args...));
}
int que[64];
int ans[64];
int mark[64];
int loop;
inline void query(int x) {
  loop--;
  cout << x << endl;
  cout.flush();
}
inline int get() {
  int x;
  cin >> x;
  if (x == 0) exit(0);
  if (x == -2) exit(0);
  return x;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  while (cin >> m >> n) {
    loop = 60;
    memset(mark, -1, sizeof(mark));
    for (int i = (int)(1); i <= (int)(n); i++) {
      int r = 1;
      query(r);
      ans[i] = get();
      if (ans[i] == 0) {
        return 0;
      }
      if (ans[i] < 0)
        mark[i] = 0;
      else
        mark[i] = 1;
    }
    int low = 1, high = m;
    int in = 1;
    while (loop > 0) {
      int mid = (low + high) / 2;
      query(mid);
      int kk = get();
      if (mark[in] == 0) kk *= -1;
      if (kk > 0)
        low = mid + 1;
      else if (kk < 0)
        high = mid - 1;
      else
        return 0;
      in++;
      if (in == n + 1) in = 1;
    }
  }
  return 0;
}
