# frozen_string_literal: true

s = gets.to_i

if s == 1
  puts '0 0 1 0 0 1'
  exit 0
end

lengths = [1, 1]
ptr = 0
`factor #{s}|sed -r 's/[0-9]*: //'`.chomp.split(' ').map(&:to_i).each do |i|
  lengths[ptr % 2] *= i
  ptr += 1
end

puts "0 0 0 #{lengths[0]} #{lengths[1]} 0"
