fun main(args: Array<String>) = shojin06c()

fun shojin06c() {
    val n = readLine()!!.toLong()

    var curr = 0L
    var i = 0

    while (curr < n) curr += ++i
    
    val answer = (1L..i).toList().let {
        if (n == curr) it else it - (curr - n)
    }.joinToString(System.lineSeparator())

    println(answer)
}
