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