CodeEff/ECCO huggingface dataset:
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))

A.insert(0,0)
sum=0


for i in range(N):
    sum=0
    tmp = A.pop(i+1)
#    print('tmp',tmp)

    for j in range(1,N):
        sum+=abs(A[j]-A[j-1])
#        print('sum',sum)
    sum+=abs(A[N-1])
    print(sum)
    A.insert(i+1,tmp)

# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))

A.insert(0,0)
A.insert(N+1,0)
sum=0


for i in range(N+1):
    sum+=abs(A[i]-A[i+1])


for j in range(1,N+1):
    tmp=0
    tmp=abs(A[j-1]-A[j+1])-abs(A[j-1]-A[j])-abs(A[j]-A[j+1])
    print((sum+tmp))
# Original solution
n = int(eval(input()))
a = [0]
a.extend(list(map(int,input().split())))
a.append(0)

cost = []

for i in range(n):
  cost.append(abs(a[i+1]-a[i]))
cost.append(abs(a[-2]))

for i in range(n):
  print((sum(cost) - cost[i]- cost[i+1] + abs(a[i+2]-a[i])))

# Optimized solution
n = int(eval(input()))
a = [0]
a.extend(list(map(int,input().split())))
a.append(0)

cost = []

for i in range(n):
  cost.append(abs(a[i+1]-a[i]))
cost.append(abs(a[-2]))

s_cost = sum(cost)
for i in range(n):
  print((s_cost - cost[i]- cost[i+1] + abs(a[i+2]-a[i])))
# Original solution
n = int(eval(input()))
As = list(map(int, input().split()))
S = 0
for i in range(n-1):
  S += abs(As[i]-As[i+1])
S += abs(As[0]) + abs(As[n-1])
for i in range(n):
  if i == 0:
    sb1 = abs(As[i])
    sb2 = abs(As[i]-As[i+1])
    ad = abs(As[i+1])
  elif i == n-1:
    sb1 = abs(As[i-1]-As[i])
    sb2 = abs(As[i])
    ad = abs(As[i-1])
  else:
    sb1 = abs(As[i-1]-As[i])
    sb2 = abs(As[i]-As[i+1])
    ad = abs(As[i-1]-As[i+1])
    
  ans = S - sb1 - sb2 + ad
  print(ans)
  

# Optimized solution
n = int(eval(input()))
As = list(map(int, input().split()))
ais = [0]
ais.extend(As)
m = 0
ais.append(m)
S = 0
for i in range(n-1):
  S += abs(As[i]-As[i+1])
S += abs(As[0]) + abs(As[n-1])
for i in range(1,n+1):
  sb1 = abs(ais[i-1]-ais[i])
  sb2 = abs(ais[i]-ais[i+1])
  ad = abs(ais[i-1]-ais[i+1])
    
  ans = S - sb1 - sb2 + ad
  print(ans)
# Original solution
import copy


def sumPrice(N, B):
    sum = 0
    for i in range(1, N):
        sum += abs(B[i] - B[i - 1])
    sum += abs(B[N-1] - B[0])
    return sum


N = int(eval(input()))
A = []
A = [int(i) for i in input().split()]
A.insert(0, 0)
for i in range(1, N + 1):
    B = copy.deepcopy(A)
    del B[i]
    print((sumPrice(N, B)))


# Optimized solution
import copy

"""
def sumPrice(N, B):
    sum = 0
    for i in range(1, N):
        sum += abs(B[i] - B[i - 1])
    sum += abs(B[N-1] - B[0])
    return sum


N = int(input())
A = []
A = [int(i) for i in input().split()]
A.insert(0, 0)
for i in range(1, N + 1):
    B = copy.deepcopy(A)
    del B[i]
    print(sumPrice(N, B))
"""
N = int(eval(input()))
A = []
A = [int(i) for i in input().split()]
A.insert(0, 0)
A.insert(N+1, 0)

defSumPrice = 0
for i in range(1, N + 2):
    defSumPrice += abs(A[i - 1] - A[i])

for i in range(1, N + 1):  # A[i] に行かない
    sumPrice = 0
    if (A[i - 1] < A[i] and A[i+1] < A[i])or(A[i - 1] > A[i] and A[i+1] > A[i]):
        if abs(A[i] - A[i - 1]) > abs(A[i] - A[i + 1]):
            sumPrice = defSumPrice - 2 * abs(A[i] - A[i + 1])
        else:
            sumPrice = defSumPrice-2*abs(A[i]-A[i-1])
    else:
        sumPrice = defSumPrice
    print(sumPrice)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split(" ")))
#print(n, a)

if n == 2:
    print((abs(a[1]) * 2))
    print((abs(a[0]) * 2))
else:
    for i in range(len(a)):
        cost = 0
        if i == 0:
            cost += abs(a[1]) + abs(a[-1])
            for j in range(1, len(a)-1):
                cost += abs(a[j] - a[j+1])
            print(cost)
        elif i == len(a)-1:
            cost += abs(a[0]) + abs(a[-2])
            for j in range(0, len(a)-2):
                cost += abs(a[j] - a[j+1])
            print(cost)
        else:
            cost += abs(a[0]) + abs(a[-1]) + abs(a[i+1] - a[i-1])
            for j in range(i-1):
                cost += abs(a[j] - a[j+1])
            for j in range(i+1, len(a)-1):
                cost += abs(a[j] - a[j+1])
            print(cost)

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split(" ")))

a.insert(0,0)
a.append(0)

total = 0
for i in range(len(a)-1):
    total += abs(a[i] - a[i+1])

for j in range(1, len(a)-1):
    print((total - abs(a[j-1] - a[j]) - abs(a[j] - a[j+1]) + abs(a[j+1]- a[j-1])))
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
A.insert(0, 0)
A.append(0)

d = []
for i in range(1, N+2):
    d.append(A[i] - A[i-1])

for i in range(N):
    dd = d.copy()
    a = dd[i]
    b = dd[i+1]
    dd[i] = a + b
    dd.pop(i+1)
    print((sum(map(abs, dd))))


# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
A.insert(0, 0)
A.append(0)

d = []
s = 0
for i in range(1, N+2):
    diff = A[i] - A[i-1]
    d.append(diff)
    s += abs(diff)


for i in range(N):
    ss = s
    ss -= abs(d[i]) + abs(d[i+1]) - abs(d[i] + d[i+1])
    print(ss)
# Original solution


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################

N = int(eval(input()))
A = list(map(int, input().split()))

def get_key(l):
    return ','.join(map(str, l))

def calc(l):
    if len(l) <= 1:
        dp[get_key(l)] = 0
        return 0

    if get_key(l) in dp:
        return dp[get_key(l)]

    x = abs(l[0]-l[1]) + calc(l[1:])
    dp[get_key(l)] = x
    return x

# 0 3 5 -1 0 みたいに
L = [0] + A + [0]
dp = {}
for i in range(1, N+1):
    l = L[0:i] + L[i+1:]
    print((calc(l)))

# Optimized solution

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################

N = int(eval(input()))
A = list(map(int, input().split()))

def calc(l):
    count = 0
    for i in range(len(l)-1):
        count += abs(l[i]-l[i+1])

    return count

# 0 3 5 -1 0 みたいに
L = [0] + A + [0]
max_L = calc(L)
#print(max_L)

# 左右引いて、左右通しで計算すればいい
for i in range(1, N+1):
    diff_minus = abs(L[i-1]-L[i])+abs(L[i]-L[i+1])
    diff_plus = abs(L[i-1]-L[i+1])
    print((max_L-diff_minus+diff_plus))
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

for i in range(n):
    ans = 0
    now = 0
    for p in a[:i] + a[i + 1:] + [0]:
        ans += abs(p - now)
        now = p
    print(ans)

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))

now = 0
d = []
for p in a + [0]:
    d.append(abs(p - now))
    now = p

a = [0] + a + [0]
sum_d = sum(d)
for i in range(n):
    ans = sum_d - (d[i] + d[i+1]) + abs(a[i] - a[i+2])
    print(ans)
# Original solution
n = int(eval(input()))
a = [0]
a.extend(list(map(int,input().split())))
a.append(0)

s = []
for i in range(n+1):
    s.append(abs(a[i]-a[i+1]))

for i in range(1,n+1):
    print((sum(s)+abs(a[i-1]-a[i+1])-(abs(a[i-1]-a[i])+abs(a[i]-a[i+1]))))


# Optimized solution
n = int(eval(input()))
a = [0]
a.extend(list(map(int,input().split())))
a.append(0)

s = []
for i in range(n+1):
    s.append(abs(a[i]-a[i+1]))
ss = sum(s)
for i in range(1,n+1):
    print((ss+abs(a[i-1]-a[i+1])-(abs(a[i-1]-a[i])+abs(a[i]-a[i+1]))))
# Original solution
N = int(eval(input()))
A = [0]
A += list(map(int, input().split()))
A += [0]
cost = [abs(A[i] - A[i+1]) for i in range(N+1)]
for i in range(1, N+1):
    print((sum(cost) - (cost[i-1] + cost[i]) + abs(A[i+1] - A[i-1])))


# Optimized solution
N = int(eval(input()))
A = [0]
A += list(map(int, input().split()))
A += [0]
cost = [abs(A[i] - A[i+1]) for i in range(N+1)]
sumcost = sum(cost)
for i in range(1, N+1):
    print((sumcost - (cost[i-1] + cost[i]) + abs(A[i+1] - A[i-1])))
# Original solution
# O(N^2)?
N = int(eval(input()))
A = [int(x) for x in input().split()]


for i in range(N):
    reg = 0
    B = A[:i] + A[i+1:]
    reg += abs(B[0]) + abs(B[-1])
    for j in range(N-2):
        reg += abs(B[j]-B[j+1])
    print(reg)

# Optimized solution
N = int(eval(input()))
A = [int(x) for x in input().split()]
A = [0] + A + [0]

S = 0
for i in range(len(A) - 1):
    S += abs(A[i] - A[i+1])
for i in range(1, len(A)-1):
    reg = S - abs(A[i-1] - A[i]) - abs(A[i] - A[i+1]) + abs(A[i-1] - A[i+1])
    print(reg)
# Original solution
import itertools as it
import collections as col
import heapq as hq
import sys
import copy as cp
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def dump(*objects):
    print(*objects, file=sys.stderr)


N = int(input())
A = [0] + list(map(int, input().split())) + [0]
dump(N, A)
B = cp.deepcopy(A)
C = cp.deepcopy(A)
for i in range(1, len(A)):
    dump(i)
    B[i] = B[i-1] + abs(A[i]-A[i-1])
for i in range(len(A)-2, -1, -1):
    dump(i)
    C[i] = C[i+1] + abs(A[i]-A[i+1])
dump(A, B, C)
for i in range(1, N+1):
    dump(i, B[i-1] + B[N+1] - B[i+1] + abs(A[i-1]-A[i+1]))
    print(B[i-1] + C[i+1] + abs(A[i-1]-A[i+1]))

exit(0)


# Optimized solution
import itertools as it
import collections as col
import heapq as hq
import sys
import copy as cp
sys.setrecursionlimit(10**9)
args = sys.argv
input = sys.stdin.readline


def dump(*objects):
    if len(args) == 2 and args[1] == "DEBUG":
        print(*objects, file=sys.stderr)


N = int(input())
A = [0] + list(map(int, input().split())) + [0]
dump(N, A)
B = cp.deepcopy(A)
C = cp.deepcopy(A)
for i in range(1, len(A)):
    dump(i)
    B[i] = B[i - 1] + abs(A[i] - A[i - 1])
for i in range(len(A) - 2, -1, -1):
    dump(i)
    C[i] = C[i+1] + abs(A[i]-A[i+1])
dump(A, B, C)
for i in range(1, N+1):
    dump(i, B[i-1] + B[N+1] - B[i+1] + abs(A[i-1]-A[i+1]))
    print(B[i-1] + C[i+1] + abs(A[i-1]-A[i+1]))

exit(0)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
for i in range(n):
    b = 0
    bud = 0
    for ai in a:
        if a[i] != ai:
            bud += abs(ai - b)
            b = ai
    bud += abs(b)
    print(bud)


# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
a.append(0)
a.insert(0, 0)
costs = []
for i in range(n + 1):
    costs.append(abs(a[i + 1] - a[i]))

s = sum(costs)
for i in range(n):
    print((s - costs[i] - costs[i + 1] + abs(a[i] - a[i + 2])))
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

a.append(0)
a.insert(0, 0)
costs = []
for i in range(n + 1):
    costs.append(abs(a[i + 1] - a[i]))

s = sum(costs)
for i in range(n):
    ans = s - costs[i] - costs[i + 1] + abs(a[i] - a[i + 2])
    print(ans)

# Optimized solution
def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))


    a.append(0)
    a.insert(0, 0)
    costs = []
    for i in range(n + 1):
        costs.append(abs(a[i + 1] - a[i]))

    s = sum(costs)
    for i in range(n):
        print((s - costs[i] - costs[i + 1] + abs(a[i] - a[i + 2])))

main()
# Original solution
N=int(eval(input()))
A= [int(i) for i in input().split()]
import copy
for i in range(N):
    B=copy.deepcopy(A)
    B.pop(i)
    dist=0
    dist=dist+abs(B[0])
    for j in range(1,N-1):
        dist=dist+abs(B[j-1]-B[j])
    dist=dist+abs(B[N-2])
    print(dist)


# Optimized solution
N=int(eval(input()))
A= [int(i) for i in input().split()]
A.insert(0,0)
A.insert(N+1,0)
dist=0
for i in range(N+1):
    dist=dist+abs(A[i]-A[i+1])

for i in range(1,N+1):
    s=dist+abs(A[i-1]-A[i+1])-(abs(A[i-1]-A[i])+abs(A[i]-A[i+1]))
    print(s)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
total = 0
p = 0
for a in A:
    total += abs(p-a)
    p = a
total += abs(p)

print((total - abs(A[0]) - abs(A[0]-A[1]) + abs(A[1])))
for n in range(1,N-1):
    print((total - abs(A[n-1]-A[n]) - abs(A[n]-A[n+1]) + abs(A[n-1]-A[n+1])))
print((total - abs(A[N-2]-A[N-1]) - abs(A[N-1]) + abs(A[N-2])))

# Optimized solution
def solve():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    total = 0
    p = 0
    for a in A:
        total += abs(p-a)
        p = a
    total += abs(p)
    
    print((total - abs(A[0]) - abs(A[0]-A[1]) + abs(A[1])))
    for n in range(1,N-1):
        print((total - abs(A[n-1]-A[n]) - abs(A[n]-A[n+1]) + abs(A[n-1]-A[n+1])))
    print((total - abs(A[N-2]-A[N-1]) - abs(A[N-1]) + abs(A[N-2])))


if __name__ == '__main__':
    solve()
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

for i in range(N):
    s = 0
    a = 0
    for j, b in enumerate(A):
        if i == j:
            continue
        s += abs(a - b)
        a = b
    s += abs(a)
    print(s)


# Optimized solution
N = int(eval(input()))
A = [0] + list(map(int, input().split())) + [0]


s = 0
for i in range(1, N+2):
    x = abs(A[i-1] - A[i])
    s += x

for i in range(1, N+1):
    x = abs(A[i-1] - A[i])
    y = abs(A[i] - A[i+1])
    z = abs(A[i-1] - A[i+1])
    print((s - x - y + z))
# Original solution
N = int(eval(input()))
A = [0]
A += list(map(int, input().split()))
A += [0]

cost = [abs(A[i] - A[i+1]) for i in range(N+1)]

for i in range(N):
    ans = sum(cost[:i]+cost[i+2:])
    ans += abs(A[i] - A[i+2])
    print(ans)

# Optimized solution
N = int(eval(input()))
A = [0]
A += list(map(int, input().split()))
A += [0]

cost = [abs(A[i] - A[i+1]) for i in range(N+1)]
original_cost = sum(cost)

for i in range(N):
    ans = original_cost
    ans -= cost[i]
    ans -= cost[i+1]
    ans += abs(A[i] - A[i+2])
    
    print(ans)
# Original solution
n = int(eval(input()))
pos = [0] + [int(i) for i in input().split()] + [0]

for l in range(n):
    cost = 0
    tmp = pos.copy()
    tmp.pop(l+1)
    for i in range(n):
        cost += abs(tmp[i+1] - tmp[i])
    print(cost)

# Optimized solution
n = int(eval(input()))
pos = [0] + [int(i) for i in input().split()] + [0]

s = 0
for i in range(n+1):
    s += abs(pos[i+1] - pos[i])

for i in range(1, n+1):
    cost = s + abs(pos[i+1] - pos[i-1]) - abs(pos[i] - pos[i-1]) - abs(pos[i+1] - pos[i])
    print(cost)
# Original solution
def except_arr(arr, i):
    pre = arr[0:i]
    post = arr[i+1:]
    return pre+post

def cc092():
    n = int(eval(input()))
    an = list(map(int, input().split()))

    for i in range(0, n):
        bn = except_arr(an, i)
        bn.extend([0])
        pos = 0
        cost = 0
        for j in bn:
            cost += abs(pos-j)
            pos = j
        print(cost)

cc092()

# Optimized solution
def cc092():
    n = int(eval(input()))
    an = [0] + list(map(int, input().split())) + [0]

    c = 0
    p = 0
    for i in an:
        c += abs(p-i)
        p = i

    for i in range(1, n+1):
        cc = abs(an[i-1]-an[i+1]) - (abs(an[i-1]-an[i]) + abs(an[i]-an[i+1]))
        print((c+cc))

cc092()
# Original solution
N = int(eval(input()))
A = [int(i) for i in input().split()]
A.insert(0, 0)
A.append(0)
ans = [0] * N

dif_1 = [0] * (N+1)
dif_2 = [0] * N

for i in range(N+1):
    dif_1[i] = abs(A[i] - A[i+1])

for i in range(N):
    dif_2[i] = abs(A[i] - A[i+2])

num = sum(dif_1)

for i in range(N):
    ans[i] = num - (dif_1[i] + dif_1[i+1]) + dif_2[i]

for i in ans:
    print(i)

# Optimized solution
N = int(eval(input()))
A = [int(i) for i in input().split()]
A.insert(0, 0)
A.append(0)

dif_1 = [0] * (N+1)
dif_2 = [0] * N

for i in range(N+1):
    dif_1[i] = abs(A[i] - A[i+1])

for i in range(N):
    dif_2[i] = abs(A[i] - A[i+2])

num = sum(dif_1)

for i in range(N):
    print((num - (dif_1[i] + dif_1[i+1]) + dif_2[i]))
# Original solution
# -*- coding: utf-8 -*-

def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))

    m = 0
    for i in range(n):
        dis = 0
        bef = 0
        if i != 0:
            if abs(a[i-1]) <= b and b <= abs(a[i+1]):
                print(m)
                continue;
        for idx, b in enumerate(a):
            if idx == i:
                continue
            dis += abs(bef - b)
            bef = b
        dis += abs(bef)
        if dis > m:
            m = dis
        print(dis)

if __name__ == '__main__':
    main()


# Optimized solution
# -*- coding: utf-8 -*-

def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))

    dis = 0
    bef = 0
    for b in a:
        dis += abs(bef - b)
        bef = b
    dis += abs(bef)
    for i in range(n):
        m = 0 if i == 0 else a[i-1]
        l = 0 if i == len(a) - 1 else a[i+1]
        print((dis - (abs(m - a[i]) + abs(a[i] - l) - abs(m - l))))

if __name__ == '__main__':
    main()
# Original solution
N = int(eval(input()))
A = input().split()#List of Str
A.append("0")

def goWithoutNum( num):
    pos = 0
    result = 0
    for i in range(N + 1):
        if i != num:
            result += abs( int( A[i]) - pos)
            pos = int(A[i])
    print( result)

for i in range(N):
    goWithoutNum(i)

# Optimized solution
N = int(eval(input()))
A = [0] + list(map(int, input().split())) + [0]
B = [abs(A[i] - A[i-1]) for i in range(N+2)]
allPath = sum(B)

def diffWithoutNum( num):
    return B[num + 1] + B[num] - abs(A[i + 1] -A[i - 1])

for i in range( 1, N + 1):
    print(( allPath - diffWithoutNum(i)))
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
A.insert(0,0)
A.append(0)
ans = []
n = len(A)
for i in range(1,len(A)-1):
    sum = 0
    for j in range(len(A)):
        if i != j:
            if i == j-1:
                sum += abs(A[j]-A[j-2])
            else:
                sum += abs(A[j]-A[j-1])
    ans.append(sum)
for i in ans:
    print(i)

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
A.insert(0,0)
A.append(0)
ans = []
n = len(A)
S = 0
for i in range(1,n):
    S += abs(A[i]-A[i-1])

for i in range(1,n-1):
    sum = S + abs(A[i+1]-A[i-1])-abs(A[i-1]-A[i])-abs(A[i]-A[i+1])
    ans.append(sum)

for i in ans:
    print(i)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
for j in range(len(A)):
    a = A[:j] + A[j+1:]
    total = abs(a[0])
    for i in range(0, len(a)-1):
        total += abs(a[i+1] - a[i])
    total += abs(a[-1])
    print(total)
    

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
total = abs(A[0]) + abs(A[1]-A[0])
lst = [abs(A[0]) + abs(A[1]-A[0]) - abs(A[1])]
for i in range(1, len(A)-1):
    total += abs(A[i+1] - A[i])
    lst += [abs(A[i+1] - A[i]) + abs(A[i] - A[i-1]) - abs(A[i+1] - A[i-1])]
total += abs(A[-1]) 
lst += [abs(A[-1]) + abs(A[-2]-A[-1])-abs(A[-2])]
for j in lst:
    print((total - j))
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
total = abs(A[0]) + abs(A[1]-A[0])
lst = [abs(A[0]) + abs(A[1]-A[0]) - abs(A[1])]
for i in range(1, len(A)-1):
    total += abs(A[i+1] - A[i])
    lst += [abs(A[i+1] - A[i]) + abs(A[i] - A[i-1]) - abs(A[i+1] - A[i-1])]
total += abs(A[-1]) 
lst += [abs(A[-1]) + abs(A[-2]-A[-1])-abs(A[-2])]
for j in lst:
    print((total - j))

# Optimized solution
x = int(eval(input()))
lst = list(map(int, input().split()))
lst.append(0)
lst.insert(0, 0)
S = 0
for i in range(1, x+2):
    S += abs(lst[i-1] - lst[i])
for i in range(1, x+1):
    print((S + abs(lst[i-1] -lst[i+1]) - (abs(lst[i-1]-lst[i]) + abs(lst[i]-lst[i+1]))))
# Original solution
import sys
input = sys.stdin.readline

def costs(a):
    prev = 0
    for x in a:
        yield abs(x - prev)
        prev = x

def main():
    eval(input())
    A = [0] + [int(c) for c in input().split()] + [0]
    total = sum(costs(A))
    for i, x in enumerate(A):
        if i == 0 or i == len(A)-1: continue
        prev_cost = abs(x - A[i-1])
        succ_cost = abs(A[i+1] - x)
        print((total - (prev_cost+succ_cost) + abs(A[i+1]-A[i-1])))

if __name__ == "__main__":
    main()

# Optimized solution
import sys
input = sys.stdin.readline

def costs(a):
    prev = 0
    for x in a:
        yield abs(x - prev)
        prev = x

def main():
    eval(input())
    A = [0] + [int(c) for c in input().split()] + [0]
    total = sum(costs(A))
    for i, x in enumerate(A[1:-1],1):
        prev_cost = abs(x - A[i-1])
        succ_cost = abs(A[i+1] - x)
        print((total - (prev_cost+succ_cost) + abs(A[i+1]-A[i-1])))

if __name__ == "__main__":
    main()
# Original solution
import copy

def main():
	n = int(eval(input()))
	a = list(map(int, input().split()))
	a.insert(0, 0)

	for i in range(1, n+1):
		ans = 0
		tmp = copy.deepcopy(a)
		del tmp[i]

		for j in range(len(tmp)-1):
			ans += abs(tmp[j+1] - tmp[j])
		ans += abs(tmp[-1])
		print(ans)


main()


# Optimized solution
import copy

def calcAbs(a, i):
	return abs(a[i+1] - a[i-1]) - (abs(a[i] - a[i-1]) + abs(a[i+1] - a[i]))

def main():
	n = int(eval(input()))
	a = list(map(int, input().split()))
	a.insert(0, 0)
	a.insert(len(a), 0)
	#a.append(0)

	total = 0
	for j in range(len(a)-1):
		total += abs(a[j+1] - a[j])

	for i in range(1, n+2-1):
		ans = total + calcAbs(a, i) 

		print(ans)


main()
# Original solution
import math

N = int(eval(input()))
list = input().split(" ")

for k in range(N):
    change = 0
    now = 0
    for i in range(N):
        if k != i:
            if now < int(list[i]):
                change += int(list[i])-now
                now = int(list[i])
            else:
                change += now-int(list[i])
                now = int(list[i])



    change += math.fabs(now)
    change = int(change)
    print(change)


# Optimized solution
import math

N = int(eval(input()))
list = input().split(" ")
list.insert(0,"0")
list.append("0")

change = 0
now = 0
for i in range(N+1):
    if now < int(list[i]):
        change += int(list[i])-now
        now = int(list[i])
    else:
        change += now-int(list[i])
        now = int(list[i])
change += math.fabs(now)
change = int(change)

for i in range(1,N+1):
   ans = change - math.fabs(int(list[i])-int(list[i-1]))
   ans = ans - math.fabs(int(list[i+1])-int(list[i]))
   ans = ans + math.fabs(int(list[i+1])-int(list[i-1]))
   ans = int(ans)
   print(ans)
# Original solution
from copy import deepcopy

n = int(eval(input()))
a = [0] + list(map(int, input().split())) + [0]

for i in range(1, n + 1):
    total = 0
    b = deepcopy(a)
    b.pop(i)
    for j in range(n):
        total += abs(b[j + 1] - b[j])
    print(total)

# Optimized solution
n = int(eval(input()))
a = [0] + list(map(int, input().split())) + [0]

costs = []
for i in range(n + 1):
    costs.append(abs(a[i + 1] - a[i]))

s = sum(costs)
for i in range(n):
    print((s - costs[i] - costs[i + 1] + abs(a[i] - a[i + 2])))
# Original solution
n=int(eval(input()))
x=[int(i) for i in input().split()]
#print(n,x)
for i in range(n):
  y=x[0:i]+x[i+1:]
#  print(y)
  dist=abs(y[0])
  for j in range(len(y)-1):
    dist+=abs(y[j]-y[j+1])
  dist+=abs(y[-1])
  print(dist)

# Optimized solution
n=int(eval(input()))
x=[int(i) for i in input().split()]

dist=abs(x[0])
for i in range(n-1):
  dist+=abs(x[i]-x[i+1])
dist+=abs(x[-1])

print((dist-abs(x[0])-abs(x[0]-x[1])+abs(x[1])))

for i in range(1,n-1):
  if x[i-1]<=x[i]<=x[i+1] or x[i+1]<=x[i]<=x[i-1]:
    print(dist)
  else:
    print((dist-abs(x[i-1]-x[i])-abs(x[i]-x[i+1])+abs(x[i-1]-x[i+1])))

print((dist-abs(x[-1])-abs(x[-1]-x[-2])+abs(x[-2])))
# Original solution
N=int(eval(input()))
a=list(map(int,input().split()))
a.append(0)
cost=0
for idx in range(N):
    b=a.copy()
    b.pop(idx)
    cost=0
    for i in range(len(b)):
        if i==0:
            cost+=abs(b[i])
        else:
            cost+=abs(b[i-1]-b[i])
    print(cost)

# Optimized solution
N=int(eval(input()))
a=list(map(int,input().split()))
a.insert(0,0)
a.append(0)
cost=[]
for i in range(N+1):
    if i==0:
        cost.append(abs(a[i]))
    else:
        cost.append(abs(a[i-1]-a[i]))
cost.append(abs(a[N]))
S=sum(cost)
for i in range(N):
    print((S-cost[i+1]-cost[i+2]+abs(a[i+2]-a[i])))
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))
for i in range(N):
    B=A[:i]+A[i+1:]
    print((sum(abs(x-y)for x,y in zip([0]+B,B+[0]))))

# Optimized solution
N=int(eval(input()))
A=[0]+list(map(int,input().split()))+[0]
S=sum(abs(x-y)for x,y in zip(A,A[1:]))
for i in range(1,N+1):
    print((S-abs(A[i]-A[i-1])-abs(A[i]-A[i+1])+abs(A[i-1]-A[i+1])))
# Original solution
import copy
n=int(eval(input()))
a=list(map(int,input().split()))
for i in range(n):
  aa=copy.copy(a)
  del aa[i]
  ans=0
  temp=0
  for j in range(n-1):
    ans=ans+abs(aa[j]-temp)
    temp=aa[j]
  print((ans+abs(temp)))

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
ans=0
temp=0
for i in range(n):
  ans=ans+abs(a[i]-temp)
  temp=a[i]
ans=ans+abs(temp)
a.insert(0,0)
a.append(0)
for i in range(1,n+1):
  print((ans-abs(a[i]-a[i-1])-abs(a[i+1]-a[i])+abs(a[i+1]-a[i-1])))