from functools import reduce from sys import stdin def main(): input = lambda: stdin.readline()[:-1] N = int(input()) Y = list(map(int, input().split())) sum_a = reduce(lambda x, y: x + y, Y) ans = [] for b in Y: ans.append(sum_a - b * (N - 1)) print(*ans) main()