#include <bits/stdc++.h>
using namespace std;
long long dp[6][10001];
long long maxr(int hits, int left) {
  if (dp[hits][left] == -1ll) {
    if (hits == 1) {
      dp[hits][left] = left;
    } else if (hits == 0) {
      dp[hits][left] = 0;
    } else {
      dp[hits][left] = 0;
      for (int i = 0; i <= left; i++) {
        dp[hits][left] +=
            maxr(hits - 1, min(10000ll, left + dp[hits][left])) + 1;
      }
      dp[hits][left]--;
    }
  }
  return dp[hits][left];
}
int res;
int main() {
  memset(dp, -1, sizeof dp);
  long long left = 1;
  for (int i = 5; i >= 1; i--) {
    vector<long long> index;
    cout << min(10000ll, left) << " ";
    index.push_back(left);
    long long toHit = left;
    for (int j = 0; j < min(10000ll, toHit); j++) {
      left += maxr(i - 1, min(10000ll, left));
      cout << " " << left;
      left++;
      index.push_back(left);
    }
    cout << endl;
    cin >> res;
    if (res < 0) exit(0);
    left = index[res];
  }
}
