#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 10004205361450474ll;
long long dp[10010][5];
vector<long long> query;
long long dfs(long long l, long long q) {
  if (!q) return 0;
  if (l > 10000) l = 10000;
  if (dp[l][q]) return dp[l][q];
  long long r = l;
  for (long long i = 1; i <= l; ++i) r = r + dfs(r, q - 1) + 1;
  r = r + dfs(r, q - 1);
  return dp[l][q] = r - l;
}
void interact() {
  long long cur = 1, q = 5, K;
  for (long long i = 1; i <= 5; ++i) {
    query.clear();
    query.push_back(cur - 1);
    long long now = cur;
    for (long long j = 1; j <= min(cur, 10000ll); ++j) {
      now += dp[min(now, 10000ll)][q - 1];
      query.push_back(now);
      ++now;
    }
    cout << query.size() - 1 << ' ';
    for (long long i = 1; i < query.size(); ++i) cout << query[i] << ' ';
    cout << endl;
    cin >> K;
    if (K == -1) exit(0);
    cur = query[K] + 1;
    --q;
  }
}
signed main() {
  dfs(1, 5);
  interact();
  return 0;
}
