fun main(args: Array<String>) {
    val (x, y, z, k) = readLine()!!.split(" ").map(String::toLong)
    val xList = readLine()!!.split(" ").map(String::toLong).sortedDescending()
    val yList = readLine()!!.split(" ").map(String::toLong).sortedDescending()
    val zList = readLine()!!.split(" ").map(String::toLong).sortedDescending()

    val nums = mutableListOf<Long>()
    for (xi in xList.indices) {
        for (yi in yList.indices) {
            if (xi * yi > k) break
            for (zi in zList.indices) {
                if (xi * yi * zi > k) break
                val sum = xList[xi] + yList[yi] + zList[zi]
                nums.add(sum)
            }
        }
    }
    nums.sortDescending()
    for (i in 0 until k.toInt()) {
        println(nums[i])
    }
}