#include <bits/stdc++.h>
using namespace std;
using cat = long long;
void query(vector<cat> numbers, cat& mi, cat& mx, int& q) {
  cout << numbers.size();
  for (auto it = numbers.begin(); it != numbers.end(); it++) cout << " " << *it;
  cout << endl;
  int ans;
  cin >> ans;
  if (ans < 0) exit(0);
  if ((int)numbers.size() > ans) mx = numbers[ans] - 1;
  if (ans > 0) mi = numbers[ans - 1] + 1;
  q--;
}
void over10000(cat& mi, cat& mx, int& q) {
  int K = 10000;
  while (q > 0) {
    vector<cat> numbers;
    cat dist = (mx - mi + 1) / (K + 1) + 1;
    cat cur = mi - 1 + dist;
    while ((int)numbers.size() < K && cur <= mx) {
      numbers.push_back(cur);
      cur += dist;
    }
    query(numbers, mi, mx, q);
  }
  assert(0);
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(10);
  cat ask[] = {204761410474LL, 2046, 6, 2, 1};
  cat mi = 1, mx = 10004205361450474LL;
  int q = 5;
  for (int k = 0; k < 5; k++) {
    cout << "1 " << ask[k] << endl;
    q--;
    int ans;
    cin >> ans;
    if (ans < 0) return 0;
    if (ans == 0) {
      mx = ask[k] - 1;
      continue;
    } else {
      mi = ask[k] + 1;
      break;
    }
  }
  if (mi >= 10000) over10000(mi, mx, q);
  if (q == 3) {
    cat dist = 10001 * 10001, cur = mx + 1;
    vector<cat> numbers;
    for (int i = 0; i < mi; i++) {
      cur -= dist;
      numbers.push_back(cur);
    }
    reverse(begin(numbers), end(numbers));
    query(numbers, mi, mx, q);
  }
  if (mi >= 10000) over10000(mi, mx, q);
  if (q == 2) {
    vector<cat> numbers;
    if (mx > 10000) {
      cat dist = 10001, cur = mx + 1 - dist;
      while ((int)numbers.size() < mi && cur >= mi) {
        numbers.push_back(cur);
        cur -= dist;
      }
      numbers.pop_back();
      numbers.push_back((2047 * 2 + 1) * 2);
      numbers.push_back(2047 * 2);
      reverse(begin(numbers), end(numbers));
    } else {
      cat cur = 2 * mi;
      while ((int)numbers.size() < mi && cur <= mx) {
        numbers.push_back(cur);
        cur = (cur + 1) * 2;
      }
    }
    query(numbers, mi, mx, q);
  }
  if (mi >= 10000) over10000(mi, mx, q);
  assert(mx - mi + 1 <= min(mi, 10000LL));
  vector<cat> numbers;
  for (cat i = mi; i <= mx; i++) numbers.push_back(i);
  query(numbers, mi, mx, q);
  return 0;
}
