fun main(args: Array<String>) {
    val xyzk = readLine()!!.split(" ").map { it.toInt() }
    val x = xyzk[0]
    val y = xyzk[1]
    val z = xyzk[2]
    val K = xyzk[3]
    val a = readLine()!!.split(" ").map { it.toLong() }.sortedDescending()
    val b = readLine()!!.split(" ").map { it.toLong() }.sortedDescending()
    val c = readLine()!!.split(" ").map { it.toLong() }.sortedDescending()

    val ans = mutableListOf<Long>()

    for(i in 0 until x){
        for(j in 0 until y){
            for(k in 0 until z){
                val rank = (i+1)*(j+1)*(k+1)
                if(rank>K) break
                ans.add(a[i]+b[j]+c[k])
            }
        }
    }

    println( ans.sortedDescending().take(K).joinToString("\n") )

}
