require 'set'

class PriorityQueue < SortedSet
  @@id = 0

  def << obj
    add obj
  end

  def add obj
    super([obj,@@id])
    @@id+=1
  end

  def at idx
    super idx
  end

  def top
    self.min[0]
  end

  def pop
    self.delete(self.min)
  end
end

s = PriorityQueue.new

input = gets.split(' ').map(&:to_i)

for i in input
  s << i
end

arr = []
5.times do
  arr << s.top
  s.pop
end

puts arr.reverse.join(' ')