I=lambda:list(map(int,input().split()));x,y,z,k=I();S=sorted;s=lambda a,b:S(i+j for i in a for j in b)[:-k-1:-1];print((*s(s(S(I()),S(I())),S(I()))))
from numpy import*;I=lambda:int64(input().split());x,y,z,k=I();s=lambda a,b:sort(ravel([b+i for i in a]))[:-k-1:-1];print((*s(s(I(),I()),I())))
I = lambda: list(map(int, input().split()))
x, y, z, k = I()
S = sorted
s = lambda a, b: S(i + j for i in a for j in b)[: -k - 1 : -1]
print((*s(s(S(I()), S(I())), S(I()))))

from numpy import *

I = lambda: int64(input().split())
x, y, z, k = I()
s = lambda a, b: sort(ravel([b + i for i in a]))[: -k - 1 : -1]
print((*s(s(I(), I()), I())))

-I = lambda: list(map(int, input().split())) +from numpy import * + +I = lambda: int64(input().split()) -S = sorted -s = lambda a, b: S(i + j for i in a for j in b)[: -k - 1 : -1] -print((*s(s(S(I()), S(I())), S(I())))) +s = lambda a, b: sort(ravel([b + i for i in a]))[: -k - 1 : -1] +print((*s(s(I(), I()), I())))