s=gets.to_i
n=(s.even?) ? (s/2) : s/2+1
(0..n).each do |x1|
  (0..n).each do |y1|
    (0..n).each do |x2|
      maxy=n
      miny=0
      maxy=(s-y1*x2)/x1 if x1!=0 and n > ((s-y1*x2)/x1)
      miny=(-s+y1*x2)/x1 if x1!=0 or ((-s+y1*x2)/x1 > 0)
      (miny..maxy).each do |y2|
        if s==(x2*y1-x1*y2).abs
          puts "0 0 #{x1} #{y1} #{x2} #{y2}"
          exit
          break
        end
      end
    end
  end
end