#include <bits/stdc++.h>
using namespace std;
using LL = long long;
map<LL, LL> f[6];
LL DP(LL l, int q) {
  if (q == 0) return 0;
  if (f[q].find(l) != f[q].end()) return f[q][l];
  LL r = l;
  for (int i = 0; i <= l; ++i) {
    r = r + DP(min(r, 10000LL), q - 1) + 1;
  }
  return f[q][l] = r - l - 1;
}
int main() {
  ios::sync_with_stdio(false);
  DP(1, 5);
  LL l = 1;
  for (int i = 5; i >= 1; --i) {
    vector<LL> r;
    LL now = l;
    if (i == 1) {
      for (int j = 0; j < min(l, 10000LL); ++j) {
        r.push_back(l + j);
      }
    } else {
      for (int j = 1; j <= min(l, 10000LL); ++j) {
        now = now + DP(min(now, 10000LL), i - 1);
        r.push_back(now);
        ++now;
      }
    }
    cout << r.size() << " ";
    for (LL a : r) cout << a << " ";
    cout << endl;
    int ans;
    cin >> ans;
    if (ans < 0) return 0;
    if (ans == 0) continue;
    l = r[ans - 1] + 1;
  }
  return 0;
}
