#include <bits/stdc++.h>
using namespace std;
int ask(vector<long long> &q) {
  printf("%d ", q.size());
  for (int i = 0; i < q.size(); i++) printf("%lld ", q[i]);
  printf("\n");
  fflush(stdout);
  int t;
  scanf("%d", &t);
  if (t < 0) exit(0);
  return t;
}
long long f[10005][6];
bool vis[10005][6];
long long dp(long long n, int m) {
  if (!m) return 0;
  n = min(n, 10000LL);
  if (vis[n][m]) return f[n][m];
  vis[n][m] = 1;
  long long cur = n + dp(n, m - 1);
  for (int i = 1; i <= n; i++) {
    cur++;
    cur = cur + dp(cur, m - 1);
  }
  return f[n][m] = cur - n;
}
void solve(long long n, int m) {
  vector<long long> vt;
  long long cur = n + dp(n, m - 1);
  for (int i = 1; i <= min(n, 10000LL); i++) {
    vt.push_back(cur);
    cur++;
    cur = cur + dp(cur, m - 1);
  }
  int t = ask(vt);
  if (!t)
    solve(n, m - 1);
  else
    solve(vt[t - 1] + 1, m - 1);
}
int main() {
  solve(1, 5);
  return 0;
}
