#include <bits/stdc++.h>
using namespace std;
const long long N = 10000;
long long dp[N + 10][6];
void print(vector<long long> &vec) {
  printf("%lu", vec.size());
  for (auto v : vec) printf(" %lld", v);
  putchar('\n');
  fflush(stdout);
}
int main() {
  for (int i = 1; i <= N; ++i) dp[i][1] = i;
  for (int i = 2; i <= 5; ++i) {
    for (int j = 1; j <= N; ++j) {
      long long t = j;
      for (int k = 1; k <= j + 1; ++k) {
        if (t > N) {
          t += (j - k + 2) * (dp[N][i - 1] + 1);
          break;
        }
        t += dp[t][i - 1] + 1;
      }
      dp[j][i] = t - j - 1;
    }
  }
  vector<long long> pos;
  long long l = 1;
  for (int i = 5; i >= 1; --i) {
    pos.clear();
    long long st = min((long long)N, l);
    long long t = l;
    for (int j = 0; j <= min(N, l); ++j) {
      t += dp[min(t, N)][i - 1] + 1;
      if (j != min(N, l)) pos.push_back(t - 1);
    }
    print(pos);
    int x;
    scanf("%d", &x);
    if (x == -1) break;
    if (x) l = pos[x - 1] + 1;
  }
  return 0;
}
