require 'prime'
S=gets.to_i

n = Math.sqrt(S).ceil
d = (n*n)-S

if d == 0
    ret = [
        n,0,
        0,n,
        n,n,    
    ]
elsif d == 1
    ret = [
        n-1,0,
        0,n-1,
        n,n,    
    ]
else
    divs=Prime.prime_division(d)

    x = divs[0][0]
    y = d/x

    ret = [
        n-x,0,
        0,n-y,
        n,n,    
    ]
end

puts ret.join(' ')