_n1, _n2, _n3, n = gets.strip.split.map(&:to_i)
d = 3.times.map { gets.strip.split.map(&:to_i) }

s = []
d[0].each do |i|
  d[1].each do |j|
		s << i + j
  end
end

s = s.sort.reverse.slice(0, n) if s.size > n

s2 = []
s.each do |i|
	d[2].each do |j|
		s2 << i + j
	end
end	

s2.sort!.reverse!
n.times { |i| puts s2[i] }
