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