s = gets.to_i
t = Math.sqrt(s).ceil
t += 1 if t*t <= s
a = [0,0]
if s == 10**18
    a[2] = 0
    a[3] = 10**9
    a[4] = 0
    a[5] = 10**9
elsif t*t-t < s
    a[2] = t
    a[3] = 1
    a[4] = t*t-s
    a[5] = t
else
    a[2] = t-1
    a[3] = 1
    a[4] = t*t-t-s
    a[5] = t
end
puts a.join(" ")