#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
const int bign = 10033;
const long long bigm = 10004205361450474;
long long dp[bign][5];
long long qlist[bign];
const int k = 1e4;
long long getDp(long long l, int q1) {
  if (q1 < 0) return 0;
  if (l > k) l = k;
  if (dp[l][q1]) return dp[l][q1];
  if (q1 == 0) return dp[l][q1] = l;
  long long nowx = l;
  for (int i = 0; i <= l; i++) {
    nowx += (getDp(nowx, q1 - 1) + 1);
  }
  return dp[l][q1] = nowx - l - 1;
}
inline void Query(long long l, long long r, int q1) {
  long long nowx = l;
  int cnt = 0;
  for (int i = 0; i < l; i++) {
    nowx += getDp(nowx, q1 - 1);
    if (nowx > r || cnt == k) {
      break;
    }
    qlist[cnt++] = nowx;
    nowx++;
  }
  printf("%d", cnt);
  for (int i = 0; i < cnt; i++) {
    printf(" %I64d", qlist[i]);
  }
  putchar('\n');
  fflush(stdout);
  int res;
  scanf("%d", &res);
  if (res == -1) return;
  if (res == 0) {
    Query(l, qlist[0] - 1, q1 - 1);
  } else if (res == cnt) {
    Query(qlist[cnt - 1] + 1, r, q1 - 1);
  } else {
    Query(qlist[res - 1] + 1, qlist[res] - 1, q1 - 1);
  }
}
int main() { Query(1, bigm, 4); }
