require 'prime'

class Integer
  def my_divisor_list
    divisors = [1]
    primes = []
    Prime.prime_division(self).each do |prime|
      prime[1].times {primes << prime[0]}
    end

    1.upto(primes.size) do |i|
      primes.combination(i) do |prime|
        divisors << prime.inject{|a,b| a *= b}
      end
    end

    divisors.uniq!
    divisors.sort!
    return divisors
  rescue ZeroDivisionError
    return
  end
end

n = gets.to_i
s=n.my_divisor_list

x2s=s.size/2 -1 if s.size.even?
y3s=s.size/2 if s.size.even?

x2s=s.size/2 if s.size.odd?
y3s=s.size/2 if s.size.odd?

x1=0
y1=0
x2=s[x2s]
y2=0
x3=0
y3=s[y3s]
puts "#{x1} #{y1} #{x2} #{y2} #{x3} #{y3} "
