#include <bits/stdc++.h>
const bool DEBUG = false;
bool temp[2] = {true, false};
class Debug {
 private:
  int x;
  int n;
  bool truthArray[30];
  int idx;

 public:
  Debug(const int x_, const bool truthArray_[30], const int n_) {
    x = x_;
    n = n_;
    for (int i = 0; i < n; ++i) {
      truthArray[i] = truthArray_[i];
    }
    idx = 0;
  }
  int query(int y_) {
    int ans = (x < y_) ? -1 : (x == y_) ? 0 : 1;
    ans = (!truthArray[idx]) ? ans * -1 : ans;
    idx = (++idx == n) ? 0 : idx;
    return ans;
  }
} rocket(3, temp, 2);
int query(int y_) {
  int res;
  if (DEBUG) {
    std::cout << y_ << std::endl;
    res = rocket.query(y_);
  } else {
    std::cout << y_ << std::endl;
    fflush(stdout);
    std::cin >> res;
  }
  return res;
}
int main() {
  int m, n;
  std::cin >> m >> n;
  bool truthArray[30];
  int res, y;
  for (int i = 0; i < n; ++i) {
    y = m - i;
    res = query(y);
    if (res == 0) {
      exit(0);
    } else if (res == -1) {
      truthArray[i] = true;
    } else if (res == 1) {
      truthArray[i] = false;
    }
  }
  int begin = 1;
  int end = m - n;
  int idx = 0;
  while (begin <= end) {
    int mid = (begin + end) >> 1;
    res = query(mid);
    if (res == 0) {
      exit(0);
    } else {
      res = (!truthArray[idx]) ? res * -1 : res;
      idx = (++idx == n) ? 0 : idx;
      if (res == -1) {
        end = mid - 1;
      } else if (res == 1) {
        begin = mid + 1;
      }
    }
  }
  return 0;
}
