using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC123D
{
    class Program
    {
        public struct cake
        {
            public int pos_x;
            public int pos_y;
            public long delicious; 
        }
        public static List<cake> ABC = new List<cake>();
        public static int counter = 0;
        static void Main(string[] args)
        {
            // スペース区切りの整数の入力
            string[] input = Console.ReadLine().Split(' ');
            int X = int.Parse(input[0]);
            int Y = int.Parse(input[1]);
            int Z = int.Parse(input[2]);
            int K = int.Parse(input[3]);
            long[] A = new long[X];
            long[] B = new long[Y];
            long[] C = new long[Z];
            string[] inputA = Console.ReadLine().Split(' ');
            for (int i = 0; i < X; i++)
            {
                A[i] = long.Parse(inputA[i]);
            }
            Array.Sort(A);
            Array.Reverse(A);
            string[] inputB = Console.ReadLine().Split(' ');
            for (int i = 0; i < Y; i++)
            {
                B[i] = long.Parse(inputB[i]);
            }
            Array.Sort(B);
            Array.Reverse(B);
            string[] inputC = Console.ReadLine().Split(' ');
            for (int i = 0; i < Z; i++)
            {
                C[i] = long.Parse(inputC[i]);
            }
            Array.Sort(C);
            Array.Reverse(C);
            long[] AB = new long[A.Count() * B.Count()];
            for (int i = 0; i < A.Count(); i++)
            {
                for (int j = 0; j < B.Count(); j++)
                {
                    AB[i * B.Count() + j] = A[i] +B[j];
                }
            }
            Array.Sort(AB);
            Array.Reverse(AB);
            //
            Console.WriteLine(AB[0]+C[0]);
            counter = 1;
            look_round(0, 0, AB, C,K);
        }
        public static void look_round(int y,int x,long[] AB,long[] C,int K)
        {
            if (counter >= K)
            {
                return;
            }

            if (x < AB.Count()-1)
            {
                cake c1 = new cake();
                c1.pos_x =x + 1;
                c1.pos_y = y;
                c1.delicious = AB[x + 1] + C[y];
                if(ABC.Contains(c1)==false) ABC.Add(c1);
            }
            if (y < C.Count() - 1)
            {
                cake c2 = new cake();
                c2.pos_x = x;
                c2.pos_y = y + 1;
                c2.delicious = AB[x] + C[y + 1];
                if(ABC.Contains(c2)==false) ABC.Add(c2);
            }
                long max = 0;
                int tmp_x=0;
                int tmp_y = 0;
                foreach(cake c in ABC)
                {
                    if (c.delicious > max)
                    {
                        max = c.delicious;
                        tmp_x = c.pos_x;
                        tmp_y = c.pos_y;
                    }
                }
                Console.WriteLine(max);
                counter++;
                cake c3 = new cake();
                c3.pos_x = tmp_x;
                c3.pos_y = tmp_y;
                c3.delicious = max;
                ABC.Remove(c3);
                look_round(tmp_y,tmp_x, AB,C,K);
        }
    }
}


Measured memory_bytes: 28736