#include <bits/stdc++.h>
using namespace std;
signed long long M[10101][10];
signed long long hoge = 10004205361450474LL;
signed long long dp(signed long long L, int Q) {
  L = min(L, 10000LL);
  if (M[L][Q] >= 0) return M[L][Q];
  if (Q == 0) return 0;
  if (Q == 1) return L - 1;
  signed long long la = L + dp(L, Q - 1) + 1;
  int i;
  for (i = 0; i < (L); i++) la = la + 1 + dp(la + 1, Q - 1) + 1;
  return M[L][Q] = la - L - 1;
}
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  memset(M, 0xff, sizeof(M));
  signed long long L = 1;
  int Q = 5;
  while (1) {
    vector<signed long long> V;
    if (Q == 1) {
      for (i = 0; i < (min(10000LL, L)); i++) V.push_back(L + i);
    } else {
      V.push_back(L + dp(L, Q - 1) + 1);
      for (i = 0; i < (min(10000LL, L) - 1); i++)
        V.push_back(V.back() + 1 + dp(V.back() + 1, Q - 1) + 1);
    }
    cout << V.size() << endl;
    for (auto& v : V) cout << v << " ";
    cout << endl;
    cin >> x;
    if (x == -1) return;
    if (x > 0) L = V[x - 1] + 1;
    Q--;
  }
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  cout.tie(0);
  solve();
  return 0;
}
