Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = int(input())
A = [0] + list(map(int, input().split())) + [0]
size = len(A)
a = np.array([[A[i] for i in range(size) if i != l] for l in range(1, size-1)])

total = np.zeros(N, dtype='int64')

for i in range(size-2):
    total += np.abs(a[:, i]-a[:, i+1])

for i in range(N):
    print(total[i])

Fixed submission:
from collections import deque

N = int(input())
A = deque(map(int, input().split()))

A.append(0)
A.appendleft(0)

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

for i in range(N):
    print(A_sum - (A_diff[i] + A_diff[i+1]) + abs(A[i+2] - A[i]))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
 
spot = list(map(int, input().split()))
 
for i in range(n):
    total = 0
 
    pos = 0
    
    for l in range(n):
        if i != l:
            money = pos - spot[l]
            pos = spot[l]
            
            if money < 0:
                money *= -1
            total += money
 
    if pos < 0:
        pos *= -1
    total += pos
    
    print(total)

Fixed submission:
from collections import deque

N = int(input())
A = deque(map(int, input().split()))

A.append(0)
A.appendleft(0)

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

for i in range(N):
    print(A_sum - (A_diff[i] + A_diff[i+1]) + abs(A[i+2] - A[i]))

Buggy python submission (verdict: Runtime Error):
n = int(input())
 
spot = input().split()

for i in range(len(spot)):
    spot = int(spot)

for i in range(n):
    total = 0
 
    pos = 0
    
    for l in range(n):
        if i != l:
            money = pos - spot[l]
            pos = spot[l]
            
            if money < 0:
                money *= -1
            total += money
 
    if pos < 0:
        pos *= -1
    total += pos
    
    print(total)

Fixed submission:
from collections import deque

N = int(input())
A = deque(map(int, input().split()))

A.append(0)
A.appendleft(0)

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

for i in range(N):
    print(A_sum - (A_diff[i] + A_diff[i+1]) + abs(A[i+2] - A[i]))

Buggy python submission (verdict: Runtime Error):
n = int(input())
 
spot = input().split()

for i in range(len(spot)):
    spot = int(spot)

for i in range(n):
    total = 0
 
    pos = 0
    
    for l in range(n):
        if i != l:
            money = pos - int(spot[l])
            pos = int(spot[l])
            
            if money < 0:
                money *= -1
            total += money
 
    if pos < 0:
        pos *= -1
    total += pos
    
    print(total)

Fixed submission:
from collections import deque

N = int(input())
A = deque(map(int, input().split()))

A.append(0)
A.appendleft(0)

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

for i in range(N):
    print(A_sum - (A_diff[i] + A_diff[i+1]) + abs(A[i+2] - A[i]))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

spot = input().split()

for i in range(n):
    total = 0

    pos = 0
    
    for l in range(n):
        if i != l:
            money = pos - int(spot[l])
            pos = int(spot[l])
            
            if money < 0:
                money *= -1
            total += money

    if pos < 0:
        pos *= -1
    total += pos
    
    print(total)

Fixed submission:
from collections import deque

N = int(input())
A = deque(map(int, input().split()))

A.append(0)
A.appendleft(0)

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

for i in range(N):
    print(A_sum - (A_diff[i] + A_diff[i+1]) + abs(A[i+2] - A[i]))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

spot = input().split()

for i in range(n):
    total = 0

    pos = 0
    
    for l in range(n):
        if i == l:
            pass
        
        else:
            money = pos - int(spot[l])
            pos = int(spot[l])
            
            if money < 0:
                money *= -1
            total += money

    if pos < 0:
        pos *= -1
    total += pos
    
    print(total)

Fixed submission:
from collections import deque

N = int(input())
A = deque(map(int, input().split()))

A.append(0)
A.appendleft(0)

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

for i in range(N):
    print(A_sum - (A_diff[i] + A_diff[i+1]) + abs(A[i+2] - A[i]))