program exactly_n_points
  implicit none
  integer :: n, i, s, j
  read(*,*) n
  s = 0
  do i = 1, n
    s = s+i
    if (s.ge.n) then
      j = i
      exit
    end if
  end do
  do i = 1, j
    if (i.eq.s-n) cycle
    write(*,'(i0)') i
  end do
  stop
end program exactly_n_points