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