// yuki 970 数列変換マシン // 2020.1.19 bal4u #include int getchar_unlocked(void); int putchar_unlocked(int c); #define gc() getchar_unlocked() #define pc(c) putchar_unlocked(c) int in() { // 整数の入力 int n = 0; int c = gc(); if (c == '-') { c = gc(); do n = 10*n + (c & 0xf), c = gc(); while (c >= '0'); return -n; } do n = 10*n + (c & 0xf), c = gc(); while (c >= '0'); return n; } void out(int n) { // 整数の表示(出力) int i; char b[30]; if (!n) pc('0'); else { if (n < 0) pc('-'), n = -n; i = 0; while (n) b[i++] = n % 10 + '0', n /= 10; while (i--) pc(b[i]); } } int N, s; int y[100005]; int main() { int i, n; N = in(), n = N-1; for (i = 0; i < N; ++i) y[i] = in(), s += y[i]; out(s-n*y[0]); for (i = 1; i < N; ++i) pc(' '), out(s-n*y[i]); pc('\n'); return 0; }