class PriorityQueue
  attr_reader :data

  def initialize(test_function = ->(a, b) { b <=> a })
    @data = []
    @test_function = test_function
  end

  def push(elem)
    @data << elem

    n = @data.size - 1
    while (n > 0)
      parent = (n - 1) / 2
      if @test_function.call(@data[n], @data[parent]) < 0
        tmp = @data[n]
        @data[n] = @data[parent]
        @data[parent] = tmp
      end
      n = parent
    end
  end

  def pop()
    max = @data[0]
    @data[0] = @data.last
    @data.pop

    parent = 0
    loop {
      child = 2 * parent + 1
      break unless child < @data.size

      child += 1 if (child < @data.size - 1 and @test_function.call(@data[child], @data[child + 1]) > 0)
      if @test_function.call(@data[parent], @data[child]) > 0
        tmp = @data[parent]
        @data[parent] = @data[child]
        @data[child] = tmp
      end
      parent = child
    }

    max
  end
end


xyzk, a, b, c = STDIN.read.lines.map { |line| line.split(/\s+/).map(&:to_i) }
k = xyzk[-1]

a.sort! { |x, y| y <=> x }
b.sort! { |x, y| y <=> x }
c.sort! { |x, y| y <=> x }

class ValueWithIndex
  attr_reader :v, :i, :j, :k

  def initialize(v, i, j, k)
    @v = v
    @i = i
    @j = j
    @k = k
  end
end

queue = PriorityQueue.new(->(a, b) { b.v <=> a.v })

queue.push(ValueWithIndex.new(a[0] + b[0] + c[0], 0, 0, 0))
registered = Hash.new
ret = []

k.times {
  m = queue.pop
  ret << m
  [[m.i + 1, m.j, m.k],[m.i, m.j + 1, m.k],[m.i, m.j, m.k + 1]].each { |ai, bi, ci|
    next if ai >= a.size or bi >= b.size or ci >= c.size

    key = [ai, bi, ci].join(',')
    unless registered.key? key
      queue.push(ValueWithIndex.new(a[ai] + b[bi] + c[ci], ai, bi, ci))
      registered[key] = true
    end
  }
}

puts ret.map(&:v).join("\n")
