#include <bits/stdc++.h>
using namespace std;
FILE *in, *out;
int N, M, K;
long long dp[6][20100];
long long first(int q, long long x) {
  long long x_old = x;
  x = min(x, 10000ll);
  if (q == 1) {
    return x;
  }
  if (dp[q][x]) return dp[q][x];
  int i, j, k;
  long long t = first(q - 1, x);
  for (i = 1; i <= x; i++) {
    t++;
    t += first(q - 1, t + x);
  }
  dp[q][x] = t;
  return t;
}
int g(int q, long long x, long long second) {
  int i, j, k;
  long long x_old = x;
  x = min(x, 10000ll);
  if (q == 1) {
    cout << x << " ";
    for (i = 1; i <= x; i++) {
      cout << second + i << " ";
    }
    cout << "\n";
    fflush(stdout);
    cin >> i;
    exit(0);
  }
  long long t = first(q - 1, x);
  cout << x << " ";
  for (i = 1; i <= x; i++) {
    t++;
    cout << t + second << " ";
    t += first(q - 1, t + second + 1);
  }
  cout << "\n";
  fflush(stdout);
  cin >> j;
  if (j == -1) exit(0);
  if (j == -2) exit(0);
  if (j == 0) {
    g(q - 1, x, second);
    return 0;
  }
  t = first(q - 1, x);
  for (i = 0; i < j; i++) {
    t++;
    if (i + 1 == j) {
      g(q - 1, t + second + 1, t + second);
      return 0;
    }
    t += first(q - 1, t + second + 1);
  }
  return 0;
}
int read() {
  int i, j, k;
  g(5, 1, 0);
  return 0;
}
int main() {
  in = stdin;
  out = stdout;
  read();
  return 0;
}
