#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 10;
const int M = 10;
const int lim = 1e4;
const long long Inf = 10004205361450474;
int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
long long f[N][M], st[N];
int top = 0;
long long F(long long l, int rem) {
  if (!rem) return l - 1;
  if (l > lim) return min(Inf, F(lim, rem) + l - lim);
  if (f[l][rem] != -1) return f[l][rem];
  long long ret = l;
  for (int i = 1; i <= l; i++) ret = min(Inf, F(ret, rem - 1) + 2);
  ret = min(Inf, F(ret, rem - 1));
  return f[l][rem] = ret;
}
int main() {
  memset(f, -1, sizeof(f));
  long long l = 1;
  for (int rem = 4; rem >= 0; rem--) {
    long long cur = l;
    top = 0;
    for (int i = 1; i <= min(l, (long long)lim); i++) {
      cur = F(cur, rem);
      if (cur == Inf) break;
      st[++top] = cur + 1;
      cur += 2;
    }
    printf("%d\n", top);
    for (int i = 1; i <= top; i++) printf("%lld ", st[i]);
    fflush(stdout);
    int ret = gi();
    if (ret < 0) return 0;
    if (ret > 0) l = st[ret] + 1;
  }
  return 0;
}
