import scala.io.{StdIn => in}

object Main extends App {
  val n = in.readInt

  def rec(acc:Int, i:Int):(Int, Int) = {
    if(acc >= n) (i-1, acc - n)
    else rec(acc+i, i+1)
  }

  val (num, rem) = rec(0, 1)

  val out = new java.io.PrintWriter(System.out)
  (1 to num).filter(_ != rem).foreach(out.println)
  out.flush
}