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