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