N=io.read("n")
A={}
for i=2,N+1 do
  A[i]=io.read("n")
end
A[1]=0
table.insert(A,0)
local total=0
for i=2,N do
  for j=2,N+1 do
    local g=0
    local k=math.abs(A[j+g]-A[j-1+g])
    if j==i then
      k=math.abs(A[j+1]-A[j-1])
      g=1
    end
    total=total+k
  end
  print(total)
end