#include <bits/stdc++.h>
using namespace std;
const int MAXQ = 5, MAXK = 10000;
long long ub[MAXQ + 1][MAXK + 10];
long long dp(int q, long long lb) {
  if (lb > MAXK) return lb + dp(q, MAXK) - MAXK;
  if (q == 0) return lb;
  if (ub[q][lb] != -1) return ub[q][lb];
  long long x = dp(q - 1, lb);
  for (int i = 1; i <= lb; ++i) x = dp(q - 1, x + 1);
  return ub[q][lb] = x;
}
int ask(const vector<long long> &arr) {
  printf("%d ", arr.size());
  for (long long x : arr) printf("%I64d ", x);
  printf("\n");
  fflush(stdout);
  int resp;
  scanf("%d", &resp);
  return resp;
}
vector<long long> arr;
int guess(int q, long long lb) {
  long long x = dp(q - 1, lb);
  arr.clear();
  for (int i = 1; i <= min(10000LL, lb); ++i)
    arr.push_back(x), x = dp(q - 1, x + 1);
  int resp = ask(arr);
  if (resp < 0) return resp;
  if (resp > 0) return guess(q - 1, arr[resp - 1] + 1);
  return guess(q - 1, lb);
}
int main() {
  memset(ub, -1, sizeof(ub));
  cerr << dp(5, 1) << endl;
  assert(guess(5, 1) == -1);
  return 0;
}
