N = int(input())
Y = list(map(int,input().split()))
sumY = sum(Y)
X = [0]*N
for i in range(N):
    X[i] = sumY-(N-1)*Y[i]
print(*X)