#include <bits/stdc++.h>
using namespace std;
template <class T, class T2>
inline int chkmax(T &x, const T2 &y) {
  return x < y ? x = y, 1 : 0;
}
template <class T, class T2>
inline int chkmin(T &x, const T2 &y) {
  return x > y ? x = y, 1 : 0;
}
const int MAXN = (int)1e4;
const int64_t M = 10004205361450474;
int query(vector<int64_t> li) {
  cout << li.size() << " ";
  for (int64_t i : li) cout << i << " ";
  cout << '\n' << flush;
  int x;
  cin >> x;
  if (x == -1 || x == -2) exit(0);
  return x;
}
int64_t dp[MAXN + 42][6];
int64_t rec(int64_t l, int q) {
  chkmin(l, MAXN);
  if (q == 1) return l;
  int64_t &memo = dp[l][q];
  if (memo != -1) return memo;
  int64_t pos = l;
  for (int i = 0; i <= l; i++) {
    int64_t len = rec(pos, q - 1);
    pos += len;
    if (i != l) pos++;
  }
  return memo = pos - l;
}
void solve(int64_t l, int q) {
  int64_t len = min(l, (int64_t)MAXN);
  if (q == 1) {
    vector<int64_t> li;
    for (int64_t i = l; i <= l + len - 1; i++) li.push_back(i);
    query(li);
    exit(0);
  }
  vector<int64_t> li;
  int64_t pos = l;
  for (int i = 0; i < len; i++) {
    pos += rec(pos, q - 1);
    li.push_back(pos);
    pos++;
  }
  int ret = query(li);
  int64_t nw_l = (ret == 0) ? l : (li[ret - 1] + 1);
  solve(nw_l, q - 1);
}
void solve() {
  memset(dp, -1, sizeof(dp));
  solve(1, 5);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
