#include <bits/stdc++.h>
using namespace std;
const long long STARTPOINT[] = {204761410474ll, 2046ll, 6ll, 2ll, 1ll};
inline long long Calc(long long x, long long d) {
  if (d == 0) {
    return x;
  }
  if (d == 1) {
    return x + min(x + 1, 10000ll);
  }
  if (d == 2) {
    if (x >= 10000ll) return x + 100020000ll;
  }
  if (d == 3) {
    if (x >= 10000ll) return x + 1000300030000ll;
  }
  long long res = Calc(x, d - 1);
  for (long long i = 1; i <= min(x + 1, 10000ll); ++i) {
    res = Calc(res + 1, d - 1);
  }
  return res;
}
long long que[10111];
long long tot;
inline void Work(long long x, long long d) {
  if (d == 1) {
    printf("%lld", min(x + 1, 10000ll));
    for (long long i = 1; i <= min(x + 1, 10000ll); ++i) {
      printf(" %lld", x + i);
    }
    puts("");
    fflush(stdout);
    return;
  }
  printf("%lld ", min(x + 1, 10000ll));
  long long res = Calc(x, d - 1);
  for (long long i = 1; i <= min(x + 1, 10000ll); ++i) {
    que[++tot] = res + 1;
    printf(" %lld", res + 1);
    res = Calc(res + 1, d - 1);
  }
  puts("");
  fflush(stdout);
}
signed main() {
  long long pos = 1;
  long long res;
  for (long long cs = 0; cs < 5; ++cs) {
    printf("1 %lld\n", STARTPOINT[cs]);
    fflush(stdout);
    scanf("%lld", &res);
    if (res < 0) return 0;
    if (res > 0) {
      pos = STARTPOINT[cs];
      tot = 0;
      for (++cs; cs < 5; ++cs) {
        tot = 0;
        Work(pos, 5 - cs);
        scanf("%lld", &res);
        if (res < 0) return 0;
        if (res) {
          pos = que[res];
        }
      }
    }
  }
  return 0;
}
