N = int(input()) y = list(map(int, input().split())) s = sum(y) x = [2 * s - a for a in y] print(x)