n = int(eval(input()))

lst = list(map(int, input().split()))

lst.insert(0, 0)

lst.append(0)



s = 0

for i in range(len(lst)-1):

    s += abs(lst[i+1]-lst[i])

    

for i in range(1, len(lst)-1):

    a = lst[i-1]

    b = lst[i]

    c = lst[i+1]

    if (b - a > 0 and c - b > 0) or (b - a < 0 and c - b < 0):

        print(s)

    else:

        print((s - abs(b-a) - abs(c-b) + abs(c-a)))
n = int(eval(input()))

lst = list(map(int,input().split()))



s = 0

diff_lst = []

sign_lst = []

for i in lst + [0]:

    diff = i - s

    diff_lst.append(abs(diff))

    sign_lst.append(1) if diff > 0 else sign_lst.append(-1)

    s = i



su = sum(diff_lst)

for i in range(n):

    if sign_lst[i] * sign_lst[i+1] > 0:

        print(su)

    else:

        print((su - diff_lst[i] - diff_lst[i+1] + abs(diff_lst[i] - diff_lst[i+1])))
n = int(eval(input()))
lst = list(map(int, input().split()))
lst.insert(0, 0)
lst.append(0)
s = 0
for i in range(len(lst) - 1):
    s += abs(lst[i + 1] - lst[i])
for i in range(1, len(lst) - 1):
    a = lst[i - 1]
    b = lst[i]
    c = lst[i + 1]
    if (b - a > 0 and c - b > 0) or (b - a < 0 and c - b < 0):
        print(s)
    else:
        print((s - abs(b - a) - abs(c - b) + abs(c - a)))

n = int(eval(input()))
lst = list(map(int, input().split()))
s = 0
diff_lst = []
sign_lst = []
for i in lst + [0]:
    diff = i - s
    diff_lst.append(abs(diff))
    sign_lst.append(1) if diff > 0 else sign_lst.append(-1)
    s = i
su = sum(diff_lst)
for i in range(n):
    if sign_lst[i] * sign_lst[i + 1] > 0:
        print(su)
    else:
        print((su - diff_lst[i] - diff_lst[i + 1] + abs(diff_lst[i] - diff_lst[i + 1])))

-lst.insert(0, 0) -lst.append(0) -for i in range(len(lst) - 1): -    s += abs(lst[i + 1] - lst[i]) -for i in range(1, len(lst) - 1): -    a = lst[i - 1] -    b = lst[i] -    c = lst[i + 1] -    if (b - a > 0 and c - b > 0) or (b - a < 0 and c - b < 0): -        print(s) +diff_lst = [] +sign_lst = [] +for i in lst + [0]: +    diff = i - s +    diff_lst.append(abs(diff)) +    sign_lst.append(1) if diff > 0 else sign_lst.append(-1) +    s = i +su = sum(diff_lst) +for i in range(n): +    if sign_lst[i] * sign_lst[i + 1] > 0: +        print(su) -        print((s - abs(b - a) - abs(c - b) + abs(c - a))) +        print((su - diff_lst[i] - diff_lst[i + 1] + abs(diff_lst[i] - diff_lst[i + 1])))