k = gets.split(" ").map{|t| t.to_i}
a = gets.split(" ").map{|t| t.to_i}.sort{|x,y| y<=>x}
b = gets.split(" ").map{|t| t.to_i}.sort{|x,y| y<=>x}
c = gets.split(" ").map{|t| t.to_i}.sort{|x,y| y<=>x}
 

 
kari = Array.new
k[4].times{|n|
k[4].times{|m|
    kari.push(a[n]+b[m])
    }}
 
kari.sort!{|x,y| y<=>x}
kotae = Array.new
k[4].times{|n|
    k[4].times{|m|
        kotae.push(kari[n]+c[m])
        }}

kotae.sort!{|x,y| y<=>x}
k[4].times{|t|
puts kotae[t]}