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