import java.io.PrintWriter
val pw = PrintWriter(System.out)

fun main(args : Array<String>) {
    func()
    pw.flush()
}

fun func() {
    val s = nextLong()
    var r = Math.sqrt(s.toDouble()).toLong()

    if (r * r == s) {
        println("0 0 $r 0 0 $r")
        return
    }

    val diff = ((r+1) * (r+1)) - s 
    println("0 0 ${r+1} 1 $diff ${r+1}")
}

fun next() = readLine()!!
fun nextLong() = next().toLong()

fun println(value : Any) {
    pw.println(value)
}