n = int(input()) y = [int(i) for i in input().split()] sv = sum(y) ans = [] for i in range(n): ans.append(sv-y[i]*(n-1)) print(*ans)