#include <bits/stdc++.h>
const int K = 10000;
long long f[K + 10][6];
std::vector<long long> query;
long long dfs(long long l, int q) {
  if (q == 0) return 0;
  l = std::min(l, (long long)K);
  if (f[l][q]) return f[l][q];
  long long r = l;
  for (int i = 1; i <= l; ++i) r += dfs(r, q - 1) + 1;
  r += dfs(r, q - 1);
  f[l][q] = r - l;
  return f[l][q];
}
int main() {
  dfs(1, 5);
  long long r = 1;
  for (int i = 1; i <= 5; ++i) {
    query.clear();
    query.push_back(r - 1);
    int lim = std::min(r, (long long)K);
    for (int j = 1; j <= lim; ++j) {
      int _lim = std::min(r, (long long)K);
      r += f[_lim][5 - i];
      query.push_back(r++);
    }
    std::cout << query.size() - 1 << ' ';
    for (unsigned j = 1; j < query.size(); ++j) std::cout << query[j] << ' ';
    std::cout << std::endl;
    int c;
    std::cin >> c;
    if (c == -1) break;
    r = query[c] + 1;
  }
  return 0;
}
