n = int(input()) y = list(map(int, input().split())) sum_y = sum(y) x = [sum_y - (n-1)*yi for yi in y] print(' '.join(map(str, x)))