program name
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: n,i,asum
    integer(int32), allocatable:: a(:), adf(:)

    read*, n
    allocate(a(0:n+1), source=0)
    read*, a(1:n)
    allocate(adf(0:n))
    do i=0,n
        adf(i) = a(i+1) - a(i)
    end do
    deallocate(a)
    asum = sum(abs(adf))
    do i=1,n
        print'(i0)', asum - sum(abs(adf(i-1:i))) + abs(sum(adf(i-1:i)))
    end do
end program name