#include <bits/stdc++.h>
using namespace std;
const int N = 10000;
const long long INF = 10004205361450475LL;
long long dp[6][N + 5], a[N + 5];
long long Dp(int q, long long l) {
  if (q == 0) return l;
  if (l > N) return min(INF, Dp(q, N) + l - N);
  if (dp[q][l] != 0) return dp[q][l];
  long long hi = l;
  for (int i = 0; i < l; ++i) hi = Dp(q - 1, hi) + 1;
  hi = Dp(q - 1, hi);
  return dp[q][l] = min(INF, hi);
}
int main() {
  long long l = 1, r = INF;
  cerr << "note : " << Dp(5, 1) << endl;
  for (int rnd = 4; ~rnd; --rnd) {
    a[0] = l - 1;
    int k = min((long long)N, l), pos;
    printf("%d\n", k);
    for (int i = 1; i <= k; ++i) {
      a[i] = Dp(rnd, a[i - 1] + 1);
      printf("%lld%c", a[i], " \n"[i == k]);
    }
    fflush(stdout);
    if (Dp(rnd, a[k] + 1) < r) throw;
    scanf("%d", &pos);
    if (pos == -2) throw;
    if (pos == -1) return 0;
    l = a[pos] + 1;
    r = a[pos + 1];
  }
  throw;
  return 0;
}
