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