#include <bits/stdc++.h>
using namespace std;
const long long M = 10004205361450474;
long long dp[6][(int)1e4 + 1];
long long f(const int q, const long long x) {
  return q == 5 ? M : dp[q][min(x, (long long)1e4)];
}
int query(const vector<long long> &v) {
  cout << v.size() << '\n';
  for (auto &&x : v) cout << x << ' ';
  cout << endl;
  int res;
  cin >> res;
  if (res == -1) exit(0);
  if (res == -2) assert(false);
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  for (int q = 1; q < 5; ++q) {
    for (int l = 1; l <= (long long)1e4; ++l) {
      long long r = l;
      for (int rep = 0; rep <= l; ++rep)
        r += dp[q - 1][min(r, (long long)1e4)] + 1;
      dp[q][l] = r - l - 1;
    }
  }
  cerr << "Precomp Done\n";
  long long lo = 1, hi = M;
  for (int q = 5;; --q) {
    assert(lo <= hi && q > 0);
    const long long l = min(lo, (long long)1e4);
    long long r = l;
    vector<long long> v;
    for (int rep = 0; rep < l; ++rep) {
      r += f(q - 1, r) + 1;
      assert(r <= (long long)1e18);
      long long num = min(M, r - 1 - l + lo);
      if (!v.empty() && num == v.back()) break;
      assert(v.empty() || num > v.back());
      v.push_back(num);
    }
    const int i = query(v);
    if (i < v.size()) hi = v[i] - 1;
    if (i - 1 >= 0) lo = v[i - 1] + 1;
  }
  return 0;
}
