N = int(input()) Y = list(map(int,input().split())) sumY = sum(Y) sumX = (2*sumY)//(N-1) X = [] for y in Y: X.append(sumX-2*y) print(*X)