import sys

from heapq import heappush, heappop



x, y, z, k = map(int ,sys.stdin.readline().split())

a, b, c = (sorted(map(int, sys.stdin.readline().split())) for _ in range(3))



def main():

    res = []

    for i in range(x):

        for j in range(y):

            heappush(res, -(a[i] + b[j]))

    

    res2 = []

    for i in range(min(k, x * y)):

        ab = -heappop(res)

        for j in range(z):

            heappush(res2, -(ab + c[j]))

    

    for i in range(k):

        yield -heappop(res2)



if __name__ == '__main__':

    ans = main()

    print(*ans, sep='\n')

import sys

import numpy as np



x, y, z, k = map(int, sys.stdin.readline().split())

a, b, c = (np.array(sys.stdin.readline().split(), dtype=np.int64) for _ in range(3))



def main():

    res = np.sort(np.ravel(a[:, None] + b))[::-1]

    res = np.sort(np.ravel(c[:, None] + res[:min(k, x*y)]))[::-1]

    return res[:k]



if __name__ == '__main__':

    ans = main()

    print(*ans, sep='\n')

import sys
from heapq import heappush, heappop

x, y, z, k = map(int, sys.stdin.readline().split())
a, b, c = (sorted(map(int, sys.stdin.readline().split())) for _ in range(3))


def main():
    res = []
    for i in range(x):
        for j in range(y):
            heappush(res, -(a[i] + b[j]))
    res2 = []
    for i in range(min(k, x * y)):
        ab = -heappop(res)
        for j in range(z):
            heappush(res2, -(ab + c[j]))
    for i in range(k):
        yield -heappop(res2)


if __name__ == "__main__":
    ans = main()
    print(*ans, sep="\n")

import sys
import numpy as np

x, y, z, k = map(int, sys.stdin.readline().split())
a, b, c = (np.array(sys.stdin.readline().split(), dtype=np.int64) for _ in range(3))


def main():
    res = np.sort(np.ravel(a[:, None] + b))[::-1]
    res = np.sort(np.ravel(c[:, None] + res[: min(k, x * y)]))[::-1]
    return res[:k]


if __name__ == "__main__":
    ans = main()
    print(*ans, sep="\n")

-from heapq import heappush, heappop +import numpy as np -a, b, c = (sorted(map(int, sys.stdin.readline().split())) for _ in range(3)) +a, b, c = (np.array(sys.stdin.readline().split(), dtype=np.int64) for _ in range(3)) -    res = [] -    for i in range(x): -        for j in range(y): -            heappush(res, -(a[i] + b[j])) -    res2 = [] -    for i in range(min(k, x * y)): -        ab = -heappop(res) -        for j in range(z): -            heappush(res2, -(ab + c[j])) -    for i in range(k): -        yield -heappop(res2) +    res = np.sort(np.ravel(a[:, None] + b))[::-1] +    res = np.sort(np.ravel(c[:, None] + res[: min(k, x * y)]))[::-1] +    return res[:k]