Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
k = int(input().split(" ")[-1])

a_ = np.array([int(i) for i in input().split(" ")])
b_ = np.array([int(i) for i in input().split(" ")])
c_ = np.array([int(i) for i in input().split(" ")])

res = []
for a in a_:
    for b in b_:
        for c in c_:
            if len(res) == k:
                i = res.index(min(res))
                res[i] = max(res[i], a+b+c)
            else:
                res.append(a+b+c)

res = sorted(res)[::-1]

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


Fixed submission:
x,y,z,K = (int(i) for i in input().split(" "))

a_ = sorted([int(i) for i in input().split(" ")])[::-1]
b_ = sorted([int(i) for i in input().split(" ")])[::-1]
c_ = sorted([int(i) for i in input().split(" ")])[::-1]

res = []
for i in range(x):
    for j in range(y):
        for k in range(z):
            if (i+1)*(j+1)*(k+1) <= K:
                res.append(a_[i]+b_[j]+c_[k])
            else:
                break

res = sorted(res)[::-1]

for i in range(K):
    print(res[i])

Buggy python submission (verdict: Runtime Error):
import numpy as np
k = int(input().split(" ")[-1])

a_ = np.array([int(i) for i in input().split(" ")])
b_ = np.array([int(i) for i in input().split(" ")])
c_ = np.array([int(i) for i in input().split(" ")])

res = np.array([], dtype="int32")
for a in a_:
    for b in b_:
        for c in c_:
            if len(res) == k:
                i = np.argmin(res)
                res[i] = np.max(res[i], a+b+c)
            else:
                res = np.append(res,a+b+c)

res = np.sort(res)[::-1]

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

Fixed submission:
x,y,z,K = (int(i) for i in input().split(" "))

a_ = sorted([int(i) for i in input().split(" ")])[::-1]
b_ = sorted([int(i) for i in input().split(" ")])[::-1]
c_ = sorted([int(i) for i in input().split(" ")])[::-1]

res = []
for i in range(x):
    for j in range(y):
        for k in range(z):
            if (i+1)*(j+1)*(k+1) <= K:
                res.append(a_[i]+b_[j]+c_[k])
            else:
                break

res = sorted(res)[::-1]

for i in range(K):
    print(res[i])

Buggy python submission (verdict: Runtime Error):
import numpy as np
k = int(input().split(" ")[-1])

a = np.array([int(i) for i in input().split(" ")])
b = np.array([int(i) for i in input().split(" ")])
c = np.array([int(i) for i in input().split(" ")])

res = a.reshape(1,len(a)) + b.reshape(len(b),1)
res = c.reshape(1,1,len(c)) + res.reshape(len(b),len(a),1)
res = res.reshape(len(a)*len(b)*len(c),1,1)[:,0,0]
res = np.sort(res)[::-1]

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

Fixed submission:
x,y,z,K = (int(i) for i in input().split(" "))

a_ = sorted([int(i) for i in input().split(" ")])[::-1]
b_ = sorted([int(i) for i in input().split(" ")])[::-1]
c_ = sorted([int(i) for i in input().split(" ")])[::-1]

res = []
for i in range(x):
    for j in range(y):
        for k in range(z):
            if (i+1)*(j+1)*(k+1) <= K:
                res.append(a_[i]+b_[j]+c_[k])
            else:
                break

res = sorted(res)[::-1]

for i in range(K):
    print(res[i])

Buggy python submission (verdict: Time Limit Exceeded):
k = int(input().split(" ")[-1])

a_ = [int(i) for i in input().split(" ")]
b_ = [int(i) for i in input().split(" ")]
c_ = [int(i) for i in input().split(" ")]

res = []
for a in a_:
    for b in b_:
        for c in c_:
            res.append(a+b+c)

res.sort()

res = res[::-1]
for i in range(k):
    print(res[i])

Fixed submission:
x,y,z,K = (int(i) for i in input().split(" "))

a_ = sorted([int(i) for i in input().split(" ")])[::-1]
b_ = sorted([int(i) for i in input().split(" ")])[::-1]
c_ = sorted([int(i) for i in input().split(" ")])[::-1]

res = []
for i in range(x):
    for j in range(y):
        for k in range(z):
            if (i+1)*(j+1)*(k+1) <= K:
                res.append(a_[i]+b_[j]+c_[k])
            else:
                break

res = sorted(res)[::-1]

for i in range(K):
    print(res[i])