#include <bits/stdc++.h>
using namespace std;
const long long M = 10004205361450474LL;
const long long K_MAX = 10000;
const int QUERIES = 5;
long long highest_high_save[QUERIES + 1][K_MAX];
long long iterated(int queries, long long k) {
  return queries == 0 ? 0 : iterated(queries - 1, k) * (k + 1) + k;
}
long long highest_high(long long low, int queries) {
  if (queries == 0) return low - 1;
  if (low >= K_MAX) return low + iterated(queries, K_MAX) - 1;
  long long &answer = highest_high_save[queries][low];
  if (answer != -1) return answer;
  long long start = low;
  for (int i = 0; i <= low; i++) {
    long long b_low = start, b_high = 2 * M;
    while (b_low < b_high) {
      long long b_mid = (b_low + b_high + 1) / 2;
      if (highest_high(start, queries - 1) >= b_mid - 1)
        b_low = b_mid;
      else
        b_high = b_mid - 1;
    }
    start = b_low + 1;
  }
  return answer = start - 2;
}
vector<long long> solve(long long low, long long high, int queries) {
  assert(high <= highest_high(low, queries));
  vector<long long> values;
  if (iterated(queries, min(low, K_MAX)) >= high - low + 1) {
    long long length = highest_high(low, queries - 1) - low + 1;
    long long x = low + length;
    while (x <= high) {
      values.push_back(x);
      x += length + 1;
    }
    return values;
  }
  long long start = low;
  for (int i = 0; i < low; i++) {
    long long b_low = start, b_high = 2 * M;
    while (b_low < b_high) {
      long long b_mid = (b_low + b_high + 1) / 2;
      if (highest_high(start, queries - 1) >= b_mid - 1)
        b_low = b_mid;
      else
        b_high = b_mid - 1;
    }
    values.push_back(b_low);
    start = b_low + 1;
  }
  return values;
}
int query(vector<long long> sequence) {
  cout << sequence.size();
  for (long long x : sequence) cout << ' ' << x;
  cout << endl;
  int answer;
  cin >> answer;
  if (answer < 0) exit(0);
  return answer;
}
int main() {
  memset(highest_high_save, -1, sizeof(highest_high_save));
  long long low = 1, high = M, q = QUERIES;
  while (q > 0) {
    vector<long long> values = solve(low, high, q);
    int answer = query(values);
    if (answer == 0) {
      high = values[answer] - 1;
    } else if (answer == (int)values.size()) {
      low = values[answer - 1] + 1;
    } else {
      low = values[answer - 1] + 1;
      high = values[answer] - 1;
    }
    q--;
  }
  return 0;
}
