Buggy python submission (verdict: Runtime Error):
import numpy as np
numbers = input().split()
x = input().split()
y = input().split()
z = input().split()

k = int(numbers[3])
x.sort(reverse=True)
y.sort(reverse=True)
z.sort(reverse=True)

answer = []
for i in x:
    for j in y:
        price = int(i)+int(j)
        answer.append(price)
del answer[k::]
for m in range(k):
    answer[m] = answer[m] + z[m]

"""
answer.sort(reverse=True)
del answer[k::]
"""
for l in answer:
    print(l)


Fixed submission:
numbers = input().split()
x = input().split()
y = input().split()
z = input().split()

k = int(numbers[3])

answer = []
for i in x:
    for j in y:
        price = int(i)+int(j)
        answer.append(price)
answer.sort(reverse=True)
del answer[k::]
f_ans = []
for m in answer:
    for n in z:
        price = m + int(n)
        f_ans.append(price)

f_ans.sort(reverse=True)
del f_ans[k::]

for l in f_ans:
    print(l)

Buggy python submission (verdict: Time Limit Exceeded):
from functools import lru_cache

numbers = input().split()
x = input().split()
y = input().split()
z = input().split()

k = int(numbers[3])


x.sort(reverse=True)
y.sort(reverse=True)
z.sort(reverse=True)

answer = []
for i in x:
    for j in y:
        for m in z:
            price = int(i)+int(j)+int(m)
            answer.append(price)

answer.sort(reverse=True)
del answer[k::]

for l in answer:
    print(l)


Fixed submission:
numbers = input().split()
x = input().split()
y = input().split()
z = input().split()

k = int(numbers[3])

answer = []
for i in x:
    for j in y:
        price = int(i)+int(j)
        answer.append(price)
answer.sort(reverse=True)
del answer[k::]
f_ans = []
for m in answer:
    for n in z:
        price = m + int(n)
        f_ans.append(price)

f_ans.sort(reverse=True)
del f_ans[k::]

for l in f_ans:
    print(l)

Buggy python submission (verdict: Time Limit Exceeded):
numbers = input().split()
x = input().split()
y = input().split()
z = input().split()

k = int(numbers[3])


def cutting(c, k):
    del c[k::]


x.sort(reverse=True)
cutting(x, k)
y.sort(reverse=True)
cutting(y, k)
z.sort(reverse=True)
cutting(z, k)

answer = []

for i in x:
    for j in y:
        for m in z:
            price = int(i)+int(j)+int(m)
            answer.append(price)

answer.sort(reverse=True)
del answer[k::]

for l in answer:
    print(l)


Fixed submission:
numbers = input().split()
x = input().split()
y = input().split()
z = input().split()

k = int(numbers[3])

answer = []
for i in x:
    for j in y:
        price = int(i)+int(j)
        answer.append(price)
answer.sort(reverse=True)
del answer[k::]
f_ans = []
for m in answer:
    for n in z:
        price = m + int(n)
        f_ans.append(price)

f_ans.sort(reverse=True)
del f_ans[k::]

for l in f_ans:
    print(l)

Buggy python submission (verdict: Runtime Error):
numbers = input().split()
x = input().split()
y = input().split()
z = input().split()

k = int(numbers[3])


def cutting(c, k):
    del c[k::]


x.sort(reverse=True)
cutting(x)
y.sort(reverse=True)
cutting(y)
z.sort(reverse=True)
cutting(z)

answer = []

for i in x:
    for j in y:
        for m in z:
            price = int(i)+int(j)+int(m)
            answer.append(price)

answer.sort(reverse=True)
del answer[k::]

for l in answer:
    print(l)


Fixed submission:
numbers = input().split()
x = input().split()
y = input().split()
z = input().split()

k = int(numbers[3])

answer = []
for i in x:
    for j in y:
        price = int(i)+int(j)
        answer.append(price)
answer.sort(reverse=True)
del answer[k::]
f_ans = []
for m in answer:
    for n in z:
        price = m + int(n)
        f_ans.append(price)

f_ans.sort(reverse=True)
del f_ans[k::]

for l in f_ans:
    print(l)

Buggy python submission (verdict: Runtime Error):
numbers = input().split()
x = input().split()
y = input().split()
z = input().split()

k = int(numbers[3])

x.sort(reverse=True)
if len(x) > k:
    del x[k::]
y.sort(reverse=True)
if len(y) > k:
    del y[k::]
z.sort(reverse=True)
if len(z) > k:
    del z[k::]

answer = []

for i in x:
    for j in y:
        price = int(i)+int(j)
        answer.append(price)
answer[k::]

for m, mn in enumerate(z):
    price = answer[m] + mn
    answer.append(price)

answer.sort(reverse=True)
del answer[int(numbers[3])::]

for l in answer:
    print(l)


Fixed submission:
numbers = input().split()
x = input().split()
y = input().split()
z = input().split()

k = int(numbers[3])

answer = []
for i in x:
    for j in y:
        price = int(i)+int(j)
        answer.append(price)
answer.sort(reverse=True)
del answer[k::]
f_ans = []
for m in answer:
    for n in z:
        price = m + int(n)
        f_ans.append(price)

f_ans.sort(reverse=True)
del f_ans[k::]

for l in f_ans:
    print(l)

Buggy python submission (verdict: Time Limit Exceeded):
numbers = input().split()
x = input().split()
y = input().split()
z = input().split()

k = int(numbers[3])

x.sort(reverse=True)
if len(x) > k:
    del x[k::]
y.sort(reverse=True)
if len(y) > k:
    del y[k::]
z.sort(reverse=True)
if len(z) > k:
    del z[k::]

answer = []

for i in x:
    for j in y:
        for k in z:
            price = int(i)+int(j)+int(k)
            answer.append(price)

answer.sort(reverse=True)
del answer[int(numbers[3])::]

for l in answer:
    print(l)


Fixed submission:
numbers = input().split()
x = input().split()
y = input().split()
z = input().split()

k = int(numbers[3])

answer = []
for i in x:
    for j in y:
        price = int(i)+int(j)
        answer.append(price)
answer.sort(reverse=True)
del answer[k::]
f_ans = []
for m in answer:
    for n in z:
        price = m + int(n)
        f_ans.append(price)

f_ans.sort(reverse=True)
del f_ans[k::]

for l in f_ans:
    print(l)

Buggy python submission (verdict: Time Limit Exceeded):
numbers = input().split()
x = input().split()
y = input().split()
z = input().split()


x.sort(reverse=True)
y.sort(reverse=True)
z.sort(reverse=True)

answer = []

for i in x:
    for j in y:
        for k in z:
            price = int(i)+int(j)+int(k)
            answer.append(price)

answer.sort(reverse=True)
del answer[int(numbers[3])::]

for l in answer:
    print(l)


Fixed submission:
numbers = input().split()
x = input().split()
y = input().split()
z = input().split()

k = int(numbers[3])

answer = []
for i in x:
    for j in y:
        price = int(i)+int(j)
        answer.append(price)
answer.sort(reverse=True)
del answer[k::]
f_ans = []
for m in answer:
    for n in z:
        price = m + int(n)
        f_ans.append(price)

f_ans.sort(reverse=True)
del f_ans[k::]

for l in f_ans:
    print(l)