N = int(input()) a = [int(i) for i in input().split()] s = sum(a)//2 for ai in a: print(s - ai , end=" ") print()