n = int(input()) Y = list(map(int, input().split())) S = sum(Y) X = [0]*n for i in range(n): X[i] = S - (n-1)*Y[i] print(*X)