#include using namespace std::literals::string_literals; using i64 = std::int_fast64_t; using std::cout; using std::endl; using std::cin; template std::vector make_v(size_t a){return std::vector(a);} template auto make_v(size_t a,Ts... ts){ return std::vector(ts...))>(a,make_v(ts...)); } int main() { i64 n; scanf("%lld", &n); std::vector a(n); for(int i = 0; i < n; i++) scanf("%lld", &a[i]); i64 sum = accumulate(begin(a), end(a), 0LL); for(int i = 0; i < n; i++) { printf("%lld ", sum - a[i] * (n - 1)); } printf("\n"); return 0; }