(X, Y, Z, K), As, Bs, Cs = readlines.map{|l| l.split.map(&:to_i)}

$as, $bs, $cs = [As, Bs, Cs].map{|xs| [nil] + xs.sort.reverse}

class Cakes
  include Comparable
  attr_accessor :ids, :taste

  def initialize(ids)
    @ids = ids
    @taste = $as[ids[0]] + $bs[ids[1]] + $cs[ids[2]]
  end

  def <=>(other)
    @taste <=> other.taste
  end
end

class PriorityQueue
  def initialize
    @q = [nil]
    @done = Hash.new(false)
  end

  def bubble_up(i)
    pi = i / 2
    return if i <= 1 || @q[pi] >= @q[i]
    @q[i], @q[pi] = @q[pi], @q[i]
    bubble_up(pi)
  end

  def add(e)
    return if @done[e.ids]
    @q << e
    bubble_up(@q.size - 1)
    @done[e.ids] = true
  end

  def bubble_down(i)
    ci = i * 2
    return if ci > @q.size - 1
    ci += 1 if ci != @q.size - 1 && @q[ci] < @q[ci + 1]
    return if @q[i] >= @q[ci]
    @q[i], @q[ci] = @q[ci], @q[i]
    bubble_down(ci)
  end

  def pop
    @q[1], @q[-1] = @q[-1], @q[1]
    ret = @q.pop
    bubble_down(1)
    ret
  end
end

def go(x, y, z)
  $pq.add(Cakes.new([x, y, z]))
end

$pq = PriorityQueue.new
go(1, 1, 1)
K.times do |i|
  e = $pq.pop
  puts e.taste
  x, y, z = e.ids
  go(x+1, y, z) if x < X
  go(x, y+1, z) if y < Y
  go(x, y, z+1) if z < Z
end