s=gets.to_i
n=[s,10**9].min

(0..n).each do |x1|
  y2max=n
  if x1!=0
    y2max=(s*(s+1)*1.0/x1).ceil
  end
  (0..n).each do |y1|
    x2max=n
    if y1!=0
      x2max=(s*(s+1)*1.0/y1).ceil
    end
    (0..x2max).each do |x2|
      (0..y2max).each do |y2|
        if s==(x2*y1-x1*y2).abs
          puts "0 0 #{x1} #{y1} #{x2} #{y2}"
          exit
          break
        end
      end
    end
  end
end
