fun main(args: Array<String>) {
    val (x, y, z, k) = readLine()!!.split(' ').map { it.toInt() }
    val cakesA = readLine()!!.split(' ').map { it.toLong() }.sortedDescending()
    val cakesB = readLine()!!.split(' ').map { it.toLong() }.sortedDescending()
    val cakesC = readLine()!!.split(' ').map { it.toLong() }.sortedDescending()

    val queue = PriorityQueue()
    queue.push(Cakes(cakesA[0] + cakesB[0] + cakesC[0], 0, 0, 0))

    repeat(k) {

        val cakes = queue.pop()
        println(cakes.value)

        val (a, b, c) = cakes.indices()

        if (a + 1 < x) {
            queue.push(Cakes(cakesA[a + 1] + cakesB[b] + cakesC[c], a + 1, b, c))
        }

        if (b + 1 < y) {
            queue.push(Cakes(cakesA[a] + cakesB[b + 1] + cakesC[c], a, b + 1, c))
        }

        if (c + 1 < z) {
            queue.push(Cakes(cakesA[a] + cakesB[b] + cakesC[c + 1], a, b, c + 1))
        }

    }

}

private data class Cakes(val value: Long, val a: Int, val b: Int, val c: Int) {

    fun indices(): Triple<Int, Int, Int> {
        return Triple(a, b, c)
    }

}

private class PriorityQueue {

    private val heap = mutableListOf<Cakes>()

    private var size = 0

    private val set = mutableSetOf<Cakes>()

    fun push(cakes: Cakes) {
        if (set.contains(cakes)) return

        var i = size++

        while (i > 0) {
            val p = (i - 1) / 2

            if (heap[p].value >= cakes.value) break

            if (i < heap.size) {
                heap[i] = heap[p]
            } else {
                heap.add(i, heap[p])
            }

            i = p
        }

        if (i < heap.size) {
            heap[i] = cakes
        } else {
            heap.add(i, cakes)
        }

        set.add(cakes)
    }

    fun pop(): Cakes {
        val ret = heap[0]

        val x = heap[--size]
        var i = 0

        while (i * 2 + 1 < size) {
            val l = i * 2 + 1
            val r = i * 2 + 2

            val j = if (r < size && heap[l].value < heap[r].value) {
                r
            } else {
                l
            }

            if (heap[j].value <= x.value) break

            heap[i] = heap[j]
            i = j
        }

        heap[i] = x

        return ret
    }

}