#include <bits/stdc++.h>
using namespace std;
int ask(const vector<long long> query) {
  printf("%d ", (int)query.size());
  for (int i = 0; i < query.size(); i++) {
    printf("%lld%c", query[i], i == query.size() - 1 ? '\n' : ' ');
  }
  fflush(stdout);
  int ret;
  scanf("%d", &ret);
  if (ret < 0) exit(0);
  return ret;
}
int main() {
  long long i, j;
  const long long M = 10004205361450474LL;
  const long long P1 = M - (10001LL * 10001 * 10001 * 10001 - 1);
  const long long pts[5] = {P1, 2046, 6, 2, 1};
  long long ub = M, lb = 1, k = 1;
  vector<long long> query;
  for (i = 0; i < 5; i++) {
    query.clear();
    if (k == 1) {
      query = {pts[i]};
    } else if (k == 7 && i == 3) {
      query = {14, 30, 62, 126, 254, 510, 1022};
    } else if (k == 2047 && i == 2) {
      query = {16382 + 2045 * 10001};
      for (j = 1; j < k; j++) query.push_back(query.back() + 10001 * 10001);
    } else if (k == 2047 && i == 3) {
      query = {4094, 8190, 16382};
      for (j = 3; j < k; j++) query.push_back(query.back() + 10001);
    } else {
      long long step = (ub - lb + 2) / (k + 1);
      for (j = 0; j < k; j++) query.push_back(lb - 1 + (j + 1) * step);
    }
    int result = ask(query);
    if (result > 0) lb = query[result - 1] + 1;
    if (result < k) ub = query[result] - 1;
    k = min(lb, 10000LL);
  }
  return 0;
}
