fun main(args :Array<String>) {
    val (x, y, z, k) = readLongList()
    val aList = readLongList().sortedDescending()
    val bList = readLongList().sortedDescending()
    val cList = readLongList().sortedDescending()

    val tmpList = arrayListOf<Long>()
    for (i in 0 until x) {
        for (j in 0 until y) {
            for (l in 0 until z) {
                if ((i + 1) * (j +1) * (l + 1) <= k) {
                    tmpList += aList[i.toInt()] + bList[j.toInt()] + cList[l.toInt()]
                } else {
                    break
                }
            }
        }
    }

    tmpList.sortDescending()
    for (ans in tmpList.subList(0, Math.min(k.toInt(), tmpList.size))) {
        println(ans)
    }
}

fun readInteger() = readLine()!!.toInt()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)
