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

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