require 'prime'
s = gets.to_i

factors = Prime.prime_division(s)
array = []
factors.each_index do |i|
    array << factors[i][0] ** factors[i][1]
end
haba = array.max
index_max = array.index(array.max)
array.delete_at(index_max)

tate = 1
array.each_index do |i|
    tate *= array[i]
end
puts "0 #{haba} 0 0 #{tate} 0"