
require 'prime'
s = gets.to_i

arr = [[1,1]] + s.prime_division

arr2 = arr.flat_map{|(a,b)|[a] * b}

right = []
arr2.inject(1){|i,m|right << (m*i); m*i}

left = []
arr2.reverse.inject(1){|i,m|left << (m*i); m*i}
left = left.reverse[1..-1] + [1]

# p arr2
# p right
# p left


(arr2.size - 1).times do |i|
  a = right[i]
  b = left[i]
  if a <= 10**18 && b <= 10**18
    puts '0 0 0 ' + a.to_s + ' ' + b.to_s + ' 0'
    exit
  end
end


