require 'prime'
S = gets.chomp.to_i
sqrt = Math.sqrt(S).to_i
rt = (sqrt ** 2 == S) ? sqrt : (sqrt + 1)
diff = rt ** 2 - S
x1 = 0
y1 = 0
# s == (x2 * y3 - x3 * y2).abs
x2 = rt
y3 = rt
x3 = diff.zero? ? 0 : 1
y2 = diff
puts [x1, y1, x2, y2, x3, y3].join(" ")