n = int(input()) A = list(map(int, input().split())) sumA = sum(A) ANS = [] for i in range(n): ANS.append(sumA - (n - 1) * A[i]) print(*ANS)