Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))



an = [0]
for i in range(n):
    an.append(a[i])       
an.append(0)

ifsums = 0
nal = []

for i in range(1,n):
    ifsums = ifsums + abs(a[i + 1]   - a[i])

for i in range(1,n+1):
    nal.append(ifsums - ( abs(an[i] - an[i-1]) + abs(an[i+1] - an[i]) - abs(an[i+1] -  an[i-1])  ))


for i in range(len(nal)):
    print(nal[i])




Fixed submission:
n = int(input())
a = list(map(int,input().split()))



an = [0]
for i in range(n):
    an.append(a[i])       
an.append(0)

ifsums = 0
nal = []

for i in range(0,n+1):
    ifsums = ifsums + abs(an[i + 1]   - an[i])

for i in range(1,n+1):
    nal.append(ifsums - ( abs(an[i] - an[i-1]) + abs(an[i+1] - an[i]) - abs(an[i+1] -  an[i-1])  ))


for i in range(len(nal)):
    print(nal[i])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))



an = [0]
for i in range(n):
    an.append(a[i])       
an.append(0)

ifsums = 0
nal = []

for i in range(1,n+1):
    ifsums = ifsums + abs(a[i + 1]   - a[i])

for i in range(1,n+1):
    nal.append(ifsums - ( abs(an[i] - an[i-1]) + abs(an[i+1] - an[i]) - abs(an[i+1] -  an[i-1])  ))


for i in range(len(nal)):
    print(nal[i])




Fixed submission:
n = int(input())
a = list(map(int,input().split()))



an = [0]
for i in range(n):
    an.append(a[i])       
an.append(0)

ifsums = 0
nal = []

for i in range(0,n+1):
    ifsums = ifsums + abs(an[i + 1]   - an[i])

for i in range(1,n+1):
    nal.append(ifsums - ( abs(an[i] - an[i-1]) + abs(an[i+1] - an[i]) - abs(an[i+1] -  an[i-1])  ))


for i in range(len(nal)):
    print(nal[i])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))

ifsums = 0

an = [0]

for i in range(n):
    an.append(a[i])
    if i != 0 or n -1:
        ifsums = ifsums +abs(a[i] - a[i-1])
    else:
        ifsums = ifsums + abs(a[i])        
an.append(0)

nal = []

for i in range(1,n+1):
    nal.append(ifsums - ((abs(an[i] - an[i-1]) + abs(an[i+1] - an[i]) - abs(an[i+1] -  an[i-1]))))
    
for i in range(len(nal)):
    print(nal(i))




Fixed submission:
n = int(input())
a = list(map(int,input().split()))



an = [0]
for i in range(n):
    an.append(a[i])       
an.append(0)

ifsums = 0
nal = []

for i in range(0,n+1):
    ifsums = ifsums + abs(an[i + 1]   - an[i])

for i in range(1,n+1):
    nal.append(ifsums - ( abs(an[i] - an[i-1]) + abs(an[i+1] - an[i]) - abs(an[i+1] -  an[i-1])  ))


for i in range(len(nal)):
    print(nal[i])

Buggy python submission (verdict: Runtime Error):
n = int(input())
al = list(map(int,input().split()))

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

for i in range(1,n-1):
    nal.append(abs(a[i] - a[i-1]) + abs(a[i+1] - a[i]) - a[i])
    
print(ifsums - max(nal))




Fixed submission:
n = int(input())
a = list(map(int,input().split()))



an = [0]
for i in range(n):
    an.append(a[i])       
an.append(0)

ifsums = 0
nal = []

for i in range(0,n+1):
    ifsums = ifsums + abs(an[i + 1]   - an[i])

for i in range(1,n+1):
    nal.append(ifsums - ( abs(an[i] - an[i-1]) + abs(an[i+1] - an[i]) - abs(an[i+1] -  an[i-1])  ))


for i in range(len(nal)):
    print(nal[i])