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