def main():

    X, Y, Z, K = list(map(int, input().split()))

    A = list(map(int, input().split()))

    B = list(map(int, input().split()))

    C = list(map(int, input().split()))



    D = []

    for a in A:

        for b in B:

            D.append(a + b)



    D.sort(reverse=True)

    E = []

    for i in range(min(len(D),K)):

        for c in C:

            E.append(D[i] + c)



    E.sort(reverse=True)



    for i in range(K):

        print((E[i]))

        



main()
def main():

    X, Y, Z, K = list(map(int, input().split()))

    A = list(map(int, input().split()))

    B = list(map(int, input().split()))

    C = list(map(int, input().split()))

    AB = []

    for a in A:

        for b in B:

            AB.append(a + b)



    AB.sort(reverse=True)

    C.sort(reverse=True)

    ans = []

    for i in range(min(K,X*Y)):

        for j in range(min(K,Z)):

            ans.append(AB[i] + C[j])



    ans.sort(reverse=True)

    for k in range(K):

        print((ans[k]))







if __name__ == "__main__":

    main()
def main():
    X, Y, Z, K = list(map(int, input().split()))
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    D = []
    for a in A:
        for b in B:
            D.append(a + b)
    D.sort(reverse=True)
    E = []
    for i in range(min(len(D), K)):
        for c in C:
            E.append(D[i] + c)
    E.sort(reverse=True)
    for i in range(K):
        print((E[i]))


main()

def main():
    X, Y, Z, K = list(map(int, input().split()))
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    AB = []
    for a in A:
        for b in B:
            AB.append(a + b)
    AB.sort(reverse=True)
    C.sort(reverse=True)
    ans = []
    for i in range(min(K, X * Y)):
        for j in range(min(K, Z)):
            ans.append(AB[i] + C[j])
    ans.sort(reverse=True)
    for k in range(K):
        print((ans[k]))


if __name__ == "__main__":
    main()

-    D = [] +    AB = [] -            D.append(a + b) -    D.sort(reverse=True) -    E = [] -    for i in range(min(len(D), K)): -        for c in C: -            E.append(D[i] + c) -    E.sort(reverse=True) -    for i in range(K): -        print((E[i])) +            AB.append(a + b) +    AB.sort(reverse=True) +    C.sort(reverse=True) +    ans = [] +    for i in range(min(K, X * Y)): +        for j in range(min(K, Z)): +            ans.append(AB[i] + C[j]) +    ans.sort(reverse=True) +    for k in range(K): +        print((ans[k])) -main() +if __name__ == "__main__": +    main()