# util functions
include Math

# debug
$debugFlag = ( ARGV[0] != nil )
p "==== DEBUG MODE ====" if $debugFlag

def pd(str)
  p str if $debugFlag
end

def printd(str)
  print str if $debugFlag
end

# input
inputs = []
lc = 0
while l = $stdin.gets do
  if false
    inputs << l.chomp.split(" ").map(&:to_s)
  else
    inputs << l.chomp.split(" ").map(&:to_i)
  end
  lc += 1
end

ss = inputs[0][0]

# input check
if $debugFlag
  p "--- INPUT (begin) ---"
  inputs.each do |l_i|
    p l_i
  end
  p "--- INPUT (end) ---"
  print "\n"
end

# body
if $debugFlag
  p ss
end


sqrt_ss = sqrt(ss)
aa = sqrt_ss.ceil
dd = sqrt_ss.floor

if aa == dd
  puts "0 0 #{aa} 0 0 #{dd}"
  exit
end


if aa*dd - ss > 0
  bb = aa*dd - ss
  puts "0 0 #{aa} #{bb} 1 #{dd}"
else # aa*dd - ss < 0
  cc = ss - aa*dd
  puts "0 1 #{aa} 0 #{cc} #{dd + 1}"
end
