n = int(input()) y = list(map(int, input().split())) s = sum(y) x = [] for i in range(n): a = s - (n - 1) * y[i] x.append(a) print(*x)