S = gets.to_i
D = Math.sqrt(S.to_f).ceil
PTS = [0,0] + if (D**2 - S) % 2 == 0
  [D, 2, (D**2 - S)/2, D]
else
  [D+1, 2, (D**2 - 1 - S)/2, D-1]
end

x1,y1,x2,y2,x3,y3 = PTS
$stderr.puts [D, D**2, S, (x2-x1)*(y3-y1)-(x3-x1)*(y2-y1)] * " "
fail if (x2-x1)*(y3-y1)-(x3-x1)*(y2-y1) != S
puts PTS * " "
