#include <bits/stdc++.h>
using namespace std;
int query(vector<long long> Q) {
  printf("%d ", Q.size() - 2);
  for (int i = 1; i + 1 < Q.size(); i++) printf("%lld ", Q[i] - 1);
  fflush(stdout);
  int ret;
  scanf("%d", &ret);
  if (ret < 0) exit(0);
  return ret;
}
unordered_map<long long, long long> mp[10];
long long dfs(long long l, int q) {
  if (q == 1) return min(l, 10000ll);
  if (mp[q].find(l) != mp[q].end()) return mp[q][l];
  vector<long long> r;
  if (l > 10000) return dfs(10000, q);
  r.push_back(l);
  while (r.size() <= l + 1) {
    long long c = r.back();
    r.push_back(c + dfs(c, q - 1) + 1);
  }
  return mp[q][l] = r.back() - l - 1;
}
int main() {
  long long L = 1;
  for (int i = 5; i >= 2; i--) {
    vector<long long> r;
    r.push_back(L);
    while (r.size() <= min(L, 10000ll) + 1) {
      long long c = r.back();
      r.push_back(c + dfs(c, i - 1) + 1);
    }
    int ret = query(r);
    if (ret == 0)
      ;
    else if (ret == L)
      L = r[min(L, 10000ll)];
    else
      L = r[ret];
  }
  vector<long long> r;
  r.push_back(0);
  for (int i = 1; i <= L && i <= 10000; i++) r.push_back(L + i);
  r.push_back(0);
  query(r);
  return 0;
}
