import std.stdio, std.array, std.string, std.conv, std.algorithm; import std.typecons, std.range, std.random, std.math, std.container; import std.numeric, std.bigint, core.bitop, core.stdc.stdio; void main() { auto N = readln.chomp.to!int; auto A = readln.split.map!(to!int).array; auto S = A.sum; auto B = new int[](N); foreach (i; 0..N) { B[i] = -(N - 1) * A[i] + S; } B.map!(to!string).join(" ").writeln; }