import java.util.*

fun main(args: Array<String>) {
    val (X, Y, Z, K) = readLine()!!.split(" ").map {it.toInt()}
    val A = Array(3) {readLine()!!.split(" ").map{it.toLong()}}

    val Qs = Array(4) { PriorityQueue<Long>()}

    Qs[0].add(0)

    for (i in A.indices) {
        while (Qs[i].isNotEmpty()) {
            val q = Qs[i].poll()
            for (a in A[i]) {
                Qs[i + 1].add(q + a)

                if (Qs[i + 1].size > K) {
                    Qs[i + 1].poll()
                }
            }
        }
    }

    val a = Qs[3].toLongArray()
    Arrays.sort(a)
    a.reverse()

    a.forEach { println(it) }
}
