program probC
  implicit none
  integer,allocatable :: a(:), b(:)
  integer i,ans1,n,now,j

  read(*,*) n
  allocate(a(0:n+1),b(0:n+1))
  a=0
  b=0
  read(*,*) a(1:n)

!  call quicksort(b,1,n)
!  write(*,*)a

  do i =1,n
     ans1=0
     b(:) = a(:)
     b(i) = a(i-1)
     do j =1,n+1
        ans1 = ans1 + abs(b(j-1)-b(j))
     end do
     write(*,*)ans1
  end do
  
  
  
  ! ans1=ans1+abs(a(n))
  ! write(*,*)ans1,minval(a)

  ! do i = 1,n
  !    if(a(i).ne.b(1) .and. a(i).ne.b(n))then
  !       write(*,*) ans1
  !    else
  !       if(a(i)==b(1)) write(*,*) ans1 - min(abs(b(1)-b(2)),abs(b(1)-0))*2
  !       if(a(i)==b(n)) write(*,*) ans1 - min(abs(b(n)-b(n-1)),abs(b(n)-0))*2
  !    end if
  ! end do
  
end program probC
