require 'prime'

s = gets.chomp!.to_i
x = Math.sqrt(s).to_i
y = x

x1 = 0
y1 = 0

primes = Prime.prime_division(s)
sum1 = 1
sum2 = 1
primes.reverse_each do |num, count|
    count.times do |i|
        if sum1 >= sum2
            sum2 *= num
        else
            sum1 *= num
        end
    end
end
x2, y3 = [sum1, sum2].minmax

#pp x2
#pp y3

if y3 <= 10 ** 9
    puts "0 0 #{x2} 0 0 #{y3}"
else
    sum = 0
    while y3 > 10 ** 9
        if y3 % 2 == 0
            y3 /= 2
            x2 *= 2
        else
            y3 += 1
            sum += x2
        end
    end

    puts "0 0 #{x2} 1 #{sum} #{y3}" 
end
