using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using static System.Console;

class Program
{
    static void Main(string[] args)
    {
        var XYZK = ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
        var (X, Y, Z, K) = (XYZK[0], XYZK[1], XYZK[2], XYZK[3]);
        var A = ReadLine().Split(' ').Select(s => long.Parse(s)).ToArray();
        var B = ReadLine().Split(' ').Select(s => long.Parse(s)).ToArray();
        var C = ReadLine().Split(' ').Select(s => long.Parse(s)).ToArray();

        var cakes = new long[][] {
            A.OrderByDescending(x => x).ToArray(),
            B.OrderByDescending(x => x).ToArray(),
            C.OrderByDescending(x => x).ToArray()
        };

        var pq = new PriorityQueue<Cake>();
        var used = new HashSet<(int, int, int)>();

        pq.Push(new Cake(cakes.Sum(c => c[0]), (0, 0, 0)));
        used.Add((0, 0, 0));

        for (int i = 0; i < K; i++)
        {
            var cake = pq.Pop();

            WriteLine(cake.V);

            for (int j = 0; j < 3; j++)
            {
                var nextIArray = new[] { cake.I.a, cake.I.b, cake.I.c };
                nextIArray[j]++;

                var nextI = (nextIArray[0], nextIArray[1], nextIArray[2]);

                if (!used.Contains(nextI) && nextIArray[j] < cakes[j].Length)
                {
                    var nextV = cakes.Zip(nextIArray, (c, k) => c[k]).Sum();

                    pq.Push(new Cake(nextV, nextI));
                    used.Add(nextI);
                }
            }
        }
    }
}

public struct Cake : IComparable<Cake>
{
    public long V;
    public (int a, int b, int c) I;
    public Cake(long v, (int, int, int) i)
    {
        V = v;
        I = i;
    }
    public int CompareTo(Cake cake) => V.CompareTo(cake.V);
}

public class PriorityQueue<T> : IEnumerable<T>
    where T : IComparable<T>
{
    private List<T> buffer;

    public int Count { get => buffer.Count; }
    public bool IsDescending { get; }

    private int Compare(T a, T b) => IsDescending ? a.CompareTo(b) : b.CompareTo(a);

    public PriorityQueue(bool isDescending = true)
    {
        buffer = new List<T>();
        IsDescending = isDescending;
    }

    public void Push(T item)
    {
        buffer.Add(item);

        var root = 0;
        var child = buffer.Count - 1;

        while (root < child)
        {
            var parent = (child - 1) / 2;

            if (Compare(buffer[parent], buffer[child]) < 0)
                (buffer[parent], buffer[child]) = (buffer[child], buffer[parent]);

            child = parent;
        }
    }

    public T Pop()
    {
        var item = buffer[0];
        buffer[0] = buffer[^1];
        buffer.RemoveAt(buffer.Count - 1);

        var root = 0;
        var parent = root;
        var child = 1;

        while (child < buffer.Count)
        {
            if (child < buffer.Count - 1)
            {
                var leftChild = child;
                var rightChild = child + 1;

                if (Compare(buffer[leftChild], buffer[rightChild]) < 0)
                    child = rightChild;
            }

            if (Compare(buffer[parent], buffer[child]) < 0)
                (buffer[parent], buffer[child]) = (buffer[child], buffer[parent]);

            parent = child;
            child = 2 * parent + 1;
        }

        return item;
    }

    public T Peek() => buffer[0];

    public IEnumerator<T> GetEnumerator() => buffer.GetEnumerator();

    IEnumerator IEnumerable.GetEnumerator() => this.GetEnumerator();
}


Measured memory_bytes: 31468