Buggy python submission (verdict: Time Limit Exceeded):
lst = list(map(int, input().split()))
a_lst = list(map(int, input().split()))
b_lst = list(map(int, input().split()))
c_lst = list(map(int, input().split()))

k = lst[3]
candidate = []
for n, a in enumerate(sorted(a_lst, reverse=True)):
    for m, b in enumerate(sorted(b_lst, reverse=True)):
        if (n+1)*(m+1) > k:
            break
        else:
            for l, c in enumerate(sorted(c_lst, reverse=True)):
                if (n+1)*(m+1)*(l+1) > k:
                    break
                else:
                    candidate.append(a+b+c)
for i in sorted(candidate, reverse=True)[:k]:
    print(i)

Fixed submission:
x,y,z,k = map(int, input().split())
a_lst = sorted(list(map(int, input().split())), reverse=True)
b_lst = sorted(list(map(int, input().split())), reverse=True)
c_lst = sorted(list(map(int, input().split())), reverse=True)

candidate = []
for n in range(x):
    for m in range(y):
        if (n+1)*(m+1) > k:
            break
        else:
            for l in range(z):
                if (n+1)*(m+1)*(l+1) > k:
                    break
                else:
                    candidate.append(a_lst[n]+b_lst[m]+c_lst[l])
for i in sorted(candidate, reverse=True)[:k]:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
lst = list(map(int, input().split()))
a_lst = list(map(int, input().split()))
b_lst = list(map(int, input().split()))
c_lst = list(map(int, input().split()))

k = lst[3]
candidate = []
for n, a in enumerate(sorted(a_lst, key = lambda x: -x)):
    for m, b in enumerate(sorted(b_lst, key = lambda x: -x)):
        for l, c in enumerate(sorted(c_lst, key = lambda x: -x)):
            if (n+1)*(m+1)*(l+1) <= k:
                candidate.append(a+b+c)
for i in sorted(candidate, key = lambda x: -x)[:k]:
    print(i)

Fixed submission:
x,y,z,k = map(int, input().split())
a_lst = sorted(list(map(int, input().split())), reverse=True)
b_lst = sorted(list(map(int, input().split())), reverse=True)
c_lst = sorted(list(map(int, input().split())), reverse=True)

candidate = []
for n in range(x):
    for m in range(y):
        if (n+1)*(m+1) > k:
            break
        else:
            for l in range(z):
                if (n+1)*(m+1)*(l+1) > k:
                    break
                else:
                    candidate.append(a_lst[n]+b_lst[m]+c_lst[l])
for i in sorted(candidate, reverse=True)[:k]:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
lst = list(map(int, input().split()))
a_lst = list(map(int, input().split()))
b_lst = list(map(int, input().split()))
c_lst = list(map(int, input().split()))

k = lst[3]
candidate = []
for n, a in enumerate(sorted(a_lst, key = lambda x: -x)):
    for m, b in enumerate(sorted(b_lst, key = lambda x: -x)):
        for l, c in enumerate(sorted(c_lst, key = lambda x: -x)):
            if (n+1)*(m+1)*(l+1) <= k:
                candidate.append(a+b+c)
for i in sorted(candidate, key = lambda x: -x)[:k]:
    print(i)

Fixed submission:
x,y,z,k = map(int, input().split())
a_lst = sorted(list(map(int, input().split())), reverse=True)
b_lst = sorted(list(map(int, input().split())), reverse=True)
c_lst = sorted(list(map(int, input().split())), reverse=True)

candidate = []
for n in range(x):
    for m in range(y):
        if (n+1)*(m+1) > k:
            break
        else:
            for l in range(z):
                if (n+1)*(m+1)*(l+1) > k:
                    break
                else:
                    candidate.append(a_lst[n]+b_lst[m]+c_lst[l])
for i in sorted(candidate, reverse=True)[:k]:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
lst = list(map(int, input().split()))
a_lst = list(map(int, input().split()))
b_lst = list(map(int, input().split()))
c_lst = list(map(int, input().split()))

k = lst[3]
ab_lst = []
for i in a_lst:
    for j in b_lst:
        ab_lst.append(i+j)
ab_lst = sorted(ab_lst, key = lambda x: -x)[:k]
abc_lst = []
for i in ab_lst:
    for j in c_lst[:k]:
        abc_lst.append(i+j)
for i in sorted(abc_lst, key = lambda x: -x)[:k]:
    print(i)

Fixed submission:
x,y,z,k = map(int, input().split())
a_lst = sorted(list(map(int, input().split())), reverse=True)
b_lst = sorted(list(map(int, input().split())), reverse=True)
c_lst = sorted(list(map(int, input().split())), reverse=True)

candidate = []
for n in range(x):
    for m in range(y):
        if (n+1)*(m+1) > k:
            break
        else:
            for l in range(z):
                if (n+1)*(m+1)*(l+1) > k:
                    break
                else:
                    candidate.append(a_lst[n]+b_lst[m]+c_lst[l])
for i in sorted(candidate, reverse=True)[:k]:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
lst = list(map(int, input().split()))
a_lst = list(map(int, input().split()))
b_lst = list(map(int, input().split()))
c_lst = list(map(int, input().split()))

ab_lst = []
for i in a_lst:
    for j in b_lst:
        ab_lst.append(i+j)
ab_lst = sorted(ab_lst, key = lambda x: -x)[:lst[3]]
abc_lst = []
for i in ab_lst:
    for j in c_lst:
        abc_lst.append(i+j)
for i in sorted(abc_lst, key = lambda x: -x)[:lst[3]]:
    print(i)

Fixed submission:
x,y,z,k = map(int, input().split())
a_lst = sorted(list(map(int, input().split())), reverse=True)
b_lst = sorted(list(map(int, input().split())), reverse=True)
c_lst = sorted(list(map(int, input().split())), reverse=True)

candidate = []
for n in range(x):
    for m in range(y):
        if (n+1)*(m+1) > k:
            break
        else:
            for l in range(z):
                if (n+1)*(m+1)*(l+1) > k:
                    break
                else:
                    candidate.append(a_lst[n]+b_lst[m]+c_lst[l])
for i in sorted(candidate, reverse=True)[:k]:
    print(i)