program prob2
    implicit none
    integer::n, i, j
    read(*,*) n
    do i = 1, 10000
        if(N <= (i**2+i)/2) then
            do j = i, 1, -1
                if(N == 0) then
                    exit
                else if(N >= j) then
                    write(*,*) j
                    N = N - j
                end if
            end do
            stop
        end if
    end do
end program