s=gets.to_i
#s==((x1―x3)*(y2-y3)-(x2-x3)*(y1-y3)).abs
#s==(x2*y1-x1*y2).abs
n=(s.even?) ? (s/2) : s/2+1
 
(0..n).each do |x1|
  (0..n).each do |y1|
    (0..n).each do |x2|
      (0..n).each do |y2|
        if s==(x2*y1-x1*y2).abs
          puts "0 0 #{x1} #{y1} #{x2} #{y2}"
          exit
          break
        end
      end
    end
  end
end