n=int(eval(input()))

l=[0]+list(map(int,input().split()))+[0]

ans=0

for a,s in zip(l,l[1:]):

    ans+=abs(a-s)

for i in range(n):

    a,s=sorted([l[i],l[i+2]])

    if a<=l[i+1]<=s:print(ans)

    else:

        print((ans-abs(a-l[i+1])-abs(l[i+1]-s)+s-a))
n=eval(input())

l=[0]+list(map(int,input().split()))+[0]

ans=0

pre=0

for i in l:ans+=abs(pre-i);pre=i

for i in range(1,int(n)+1):

  dif=-abs(l[i]-l[i-1])-abs(l[i]-l[i+1])+abs(l[i-1]-l[i+1])

  if l[i]in(l[i-1],l[i+1]):print(ans)

  elif l[i]<l[i-1]:

    print((ans if l[i+1]<l[i] else ans+dif))

  else:print((ans if l[i+1]>l[i] else ans+dif))
n = int(eval(input()))
l = [0] + list(map(int, input().split())) + [0]
ans = 0
for a, s in zip(l, l[1:]):
    ans += abs(a - s)
for i in range(n):
    a, s = sorted([l[i], l[i + 2]])
    if a <= l[i + 1] <= s:
        print(ans)
    else:
        print((ans - abs(a - l[i + 1]) - abs(l[i + 1] - s) + s - a))

n = eval(input())
l = [0] + list(map(int, input().split())) + [0]
ans = 0
pre = 0
for i in l:
    ans += abs(pre - i)
    pre = i
for i in range(1, int(n) + 1):
    dif = -abs(l[i] - l[i - 1]) - abs(l[i] - l[i + 1]) + abs(l[i - 1] - l[i + 1])
    if l[i] in (l[i - 1], l[i + 1]):
        print(ans)
    elif l[i] < l[i - 1]:
        print((ans if l[i + 1] < l[i] else ans + dif))
    else:
        print((ans if l[i + 1] > l[i] else ans + dif))

-n = int(eval(input())) +n = eval(input()) -for a, s in zip(l, l[1:]): -    ans += abs(a - s) -for i in range(n): -    a, s = sorted([l[i], l[i + 2]]) -    if a <= l[i + 1] <= s: +pre = 0 +for i in l: +    ans += abs(pre - i) +    pre = i +for i in range(1, int(n) + 1): +    dif = -abs(l[i] - l[i - 1]) - abs(l[i] - l[i + 1]) + abs(l[i - 1] - l[i + 1]) +    if l[i] in (l[i - 1], l[i + 1]): +    elif l[i] < l[i - 1]: +        print((ans if l[i + 1] < l[i] else ans + dif)) -        print((ans - abs(a - l[i + 1]) - abs(l[i + 1] - s) + s - a)) +        print((ans if l[i + 1] > l[i] else ans + dif))