Buggy python submission (verdict: Time Limit Exceeded):
x,y,z,k=map(int,input().split())
a=[int(x) for x in input().split()]
b=[int(x) for x in input().split()]
c=[int(x) for x in input().split()]

a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

s=list()

for l in range(x):
    for m in range(y):
      for n in range(z):
        if l*m*n>k:
           break
        s.append(a[l]+b[m]+c[n])
 
s.sort(reverse=True)
for i in range(k):
  print(s[i])


Fixed submission:
x,y,z,k=map(int,input().split())
a=[int(x) for x in input().split()]
b=[int(x) for x in input().split()]
c=[int(x) for x in input().split()]

a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

s=list()

for l in range(x):
  if l>k:
    break 
  for m in range(y):
    if l*m>k:
      break
    for n in range(z):
      if l*m*n>k:
        break
      s.append(a[l]+b[m]+c[n])
 
s.sort(reverse=True)
for i in range(k):
  print(s[i])

Buggy python submission (verdict: Time Limit Exceeded):
x,y,z,k=map(int,input().split())
a=[int(x) for x in input().split()]
b=[int(x) for x in input().split()]
c=[int(x) for x in input().split()]

t=list()
for i in range(x):
  for j in range(y):
    t.append(a[i]+b[j])

s=list()
t.sort(reverse=True)
for i in range(min(k,x*y)):
  for j in range(z):
    s.append(t[i]+c[j])

s.sort(reverse=True)

for i in range(k):
  print(s[i])


Fixed submission:
x,y,z,k=map(int,input().split())
a=[int(x) for x in input().split()]
b=[int(x) for x in input().split()]
c=[int(x) for x in input().split()]

a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

s=list()

for l in range(x):
  if l>k:
    break 
  for m in range(y):
    if l*m>k:
      break
    for n in range(z):
      if l*m*n>k:
        break
      s.append(a[l]+b[m]+c[n])
 
s.sort(reverse=True)
for i in range(k):
  print(s[i])

Buggy python submission (verdict: Time Limit Exceeded):
x,y,z,k=map(int,input().split())
a=sorted(map(int,input().split()),reverse=True)
b=sorted(map(int,input().split()),reverse=True)
c=sorted(map(int,input().split()),reverse=True)

t=list()
for i in range(x):
  for j in range(y):
    t.append(a[i]+b[j])

s=list()
t.sort(reverse=True)
for i in range(min(k,x*y)):
  for j in range(z):
    s.append(t[i]+c[j])

s.sort(reverse=True)

for i in range(k):
  print(s[i])


Fixed submission:
x,y,z,k=map(int,input().split())
a=[int(x) for x in input().split()]
b=[int(x) for x in input().split()]
c=[int(x) for x in input().split()]

a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

s=list()

for l in range(x):
  if l>k:
    break 
  for m in range(y):
    if l*m>k:
      break
    for n in range(z):
      if l*m*n>k:
        break
      s.append(a[l]+b[m]+c[n])
 
s.sort(reverse=True)
for i in range(k):
  print(s[i])

Buggy python submission (verdict: Time Limit Exceeded):
X,Y,Z,K = (int(_) for _ in input().split())
A = [int(_) for _ in input().split()]
B = [int(_) for _ in input().split()]
C = [int(_) for _ in input().split()]

L=[]
K = min(K, 3000, X*Y*Z)

for x in range(X):
    for y in range(Y):
        for z in range(Z):
            L.append(A[x]+B[y]+C[z])

L.sort(reverse = True)
for i in range(K):
    print(L[i])


Fixed submission:
x,y,z,k=map(int,input().split())
a=[int(x) for x in input().split()]
b=[int(x) for x in input().split()]
c=[int(x) for x in input().split()]

a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

s=list()

for l in range(x):
  if l>k:
    break 
  for m in range(y):
    if l*m>k:
      break
    for n in range(z):
      if l*m*n>k:
        break
      s.append(a[l]+b[m]+c[n])
 
s.sort(reverse=True)
for i in range(k):
  print(s[i])

Buggy python submission (verdict: Runtime Error):
X,Y,Z,K = (int(_) for _ in input().split())
A = [int(_) for _ in input().split()]
B = [int(_) for _ in input().split()]
C = [int(_) for _ in input().split()]

L=[0]*X*Y*Z
K = min(K, 3000, X*Y*Z)

#for x in range(X):
#    for y in range(Y):
#        for z in range(Z):
#            L.append(A[x]+B[y]+C[z])

#L.sort(reverse = True)
#for i in range(K):
#    print(L[i])


Fixed submission:
x,y,z,k=map(int,input().split())
a=[int(x) for x in input().split()]
b=[int(x) for x in input().split()]
c=[int(x) for x in input().split()]

a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

s=list()

for l in range(x):
  if l>k:
    break 
  for m in range(y):
    if l*m>k:
      break
    for n in range(z):
      if l*m*n>k:
        break
      s.append(a[l]+b[m]+c[n])
 
s.sort(reverse=True)
for i in range(k):
  print(s[i])

Buggy python submission (verdict: Runtime Error):
X,Y,Z,K = (int(_) for _ in input().split())
A = [int(_) for _ in input().split()]
B = [int(_) for _ in input().split()]
C = [int(_) for _ in input().split()]

L=[0]*X*Y*Z
K = min(K, 3000, X*Y*Z)

for x in range(X):
    for y in range(Y):
        for z in range(Z):
            L.append(A[x]+B[y]+C[z])

#L.sort(reverse = True)
for i in range(K):
    print(L[i])


Fixed submission:
x,y,z,k=map(int,input().split())
a=[int(x) for x in input().split()]
b=[int(x) for x in input().split()]
c=[int(x) for x in input().split()]

a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

s=list()

for l in range(x):
  if l>k:
    break 
  for m in range(y):
    if l*m>k:
      break
    for n in range(z):
      if l*m*n>k:
        break
      s.append(a[l]+b[m]+c[n])
 
s.sort(reverse=True)
for i in range(k):
  print(s[i])

Buggy python submission (verdict: Runtime Error):
X,Y,Z,K = (int(_) for _ in input().split())
A = [int(_) for _ in input().split()]
B = [int(_) for _ in input().split()]
C = [int(_) for _ in input().split()]

L=[0]*X*Y*Z
K = min(K, 3000, X*Y*Z)

for x in range(X):
    for y in range(Y):
        for z in range(Z):
            L.append(A[x]+B[y]+C[z])

L.sort(reverse = True)
for i in range(K):
    print(L[i])


Fixed submission:
x,y,z,k=map(int,input().split())
a=[int(x) for x in input().split()]
b=[int(x) for x in input().split()]
c=[int(x) for x in input().split()]

a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

s=list()

for l in range(x):
  if l>k:
    break 
  for m in range(y):
    if l*m>k:
      break
    for n in range(z):
      if l*m*n>k:
        break
      s.append(a[l]+b[m]+c[n])
 
s.sort(reverse=True)
for i in range(k):
  print(s[i])