#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <vector>

static const int IINF = 1 << 30;
static const long long LINF = 1LL << 60;
static const long long MOD = 1.0e+9 + 7;

using llong = long long;

template <typename T> std::vector<T> vectors(std::size_t n, T val) {
  return std::vector<T>(n, val);
}

template <typename T, typename... Args>
auto vectors(std::size_t n, Args... args) {
  return std::vector<decltype(vectors<T>(args...))>(n, vectors<T>(args...));
}

template <class T> inline bool chmin(T &a, const T &b) {
  return (a > b) ? a = b, true : false;
}

template <class T> inline bool chmax(T &a, const T &b) {
  return (a < b) ? a = b, true : false;
}

template <class T> inline void chadd(T &a, const T &b) { a += b, a &= MOD; }

/// Check whether `item` in `vec` or not.
template <class T> bool in(const T &item, const std::vector<T> &vec) {
  return (std::find(vec.begin(), vec.end(), item) != vec.end()) ? true : false;
}

int main() {
  // Input
  int numRow = 3;
  std::vector<int> numCol(1 + numRow);
  for (int i = 1; i <= numRow; ++i) {
    std::cin >> numCol[i];
    assert(1 <= numCol[i] and numCol[i] <= 1000);
  }
  int K;
  std::cin >> K;
  assert(1 <= K and K <= 3000);
  std::vector<std::vector<llong>> taste(1 + numRow);
  for (int i = 1; i <= numRow; ++i) {
    taste[i].resize(1 + numCol[i]);
    for (int j = 1; j <= numCol[i]; ++j) {
      std::cin >> taste[i][j];
      assert(1 <= taste[i][j] and taste[i][j] <= 1.0e+10);
    }
  }

  // Sort
  for (int i = 1; i <= 3; ++i)
    std::sort(taste[i].begin() + 1, taste[i].end(), std::greater<llong>());

  auto compare_func = [](const std::tuple<int, int, int, llong> &left,
                         const std::tuple<int, int, int, llong> &right) {
    return std::get<3>(left) < std::get<3>(right);
  };
  std::priority_queue<std::tuple<int, int, int, llong>,
                      std::vector<std::tuple<int, int, int, llong>>,
                      decltype(compare_func)>
      que(compare_func);
  auto sum_func = [&](int a, int b, int c) {
    return taste[1][a] + taste[2][b] + taste[3][c];
  };
  que.push(std::make_tuple(1, 1, 1, sum_func(1, 1, 1)));

  // // Too heavy
  // auto visited = vectors<bool>(1 + K, 1 + K, 1 + K, false);
  // visited[1][1][1] = true;
  std::vector<std::tuple<int, int, int>> visited;
  visited.push_back(std::make_tuple(1, 1, 1));

  // Main & Output
  for (int k = 1; k <= K; ++k) {
    int j1, j2, j3;
    llong val;
    std::tie(j1, j2, j3, val) = que.top();
    que.pop();
    std::cout << val << std::endl;

    if (j1 + 1 <= numCol[1] and
        not in(std::make_tuple(j1 + 1, j2, j3), visited)) {
      llong s = sum_func(j1 + 1, j2, j3);
      que.push(std::make_tuple(j1 + 1, j2, j3, s));
      visited.push_back(std::make_tuple(j1 + 1, j2, j3));
    }
    if (j2 + 1 <= numCol[2] and
        not in(std::make_tuple(j1, j2 + 1, j3), visited)) {
      llong s = sum_func(j1, j2 + 1, j3);
      que.push(std::make_tuple(j1, j2 + 1, j3, s));
      visited.push_back(std::make_tuple(j1, j2 + 1, j3));
    }
    if (j3 + 1 <= numCol[3] and
        not in(std::make_tuple(j1, j2, j3 + 1), visited)) {
      llong s = sum_func(j1, j2, j3 + 1);
      que.push(std::make_tuple(j1, j2, j3 + 1, s));
      visited.push_back(std::make_tuple(j1, j2, j3 + 1));
    }
  }

  return 0;
}


Measured memory_bytes: 640