#include <bits/stdc++.h>
using namespace std;
const int maxk = 1e4, maxS = 6;
const long long M = 10004205361450474 + 1;
long long dp[maxS][maxk + 1];
vector<long long> cer;
long long f(int i, long long l, bool buildCer = 1) {
  int k = min<long long>(maxk, l);
  if (i == 1) {
    if (buildCer) {
      cer.resize(k);
      iota(cer.begin(), cer.end(), l);
    }
    return l + k;
  }
  if (!buildCer && dp[i][k]) return l + dp[i][k];
  if (buildCer) cer.clear();
  long long r = l;
  int rem = k;
  while (rem--) {
    r = f(i - 1, r, 0);
    if (buildCer) cer.push_back(r);
    r++;
  }
  r = f(i - 1, r, 0);
  dp[i][k] = r - l;
  return r;
}
int ask(vector<long long> t) {
  cout << t.size() << ' ';
  for (auto x : t) cout << x << ' ';
  cout << endl;
  int back;
  cin >> back;
  if (back == -1) exit(0);
  return back;
}
void find(long long l = 1, long long r = M, int rem = 5) {
  f(rem, l);
  int idx = ask(cer);
  find(idx == 0 ? l : cer[idx - 1] + 1, idx == cer.size() ? r : cer[idx],
       rem - 1);
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  find();
}
