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()
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()
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()

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()

-    for i, x in enumerate(A): -        if i == 0 or i == len(A) - 1: -            continue +    for i, x in enumerate(A[1:-1], 1):