#include using namespace std; typedef long long ll; #define inf 10e17 #define rep(i,n) for(long long i=0; i()) #define debug(x) std::cerr << (x) << std::endl; #define roll(x) for (auto&& itr : x) { cerr << (itr) << " "; } template inline void chmax(T &ans, T t) { if (t > ans) ans = t;} template inline void chmin(T &ans, T t) { if (t < ans) ans = t;} int main() { int n; cin >> n; vector y(n); rep(i, n) { cin >> y[i]; } auto sum = accumulate(y.begin(), y.end(), 0); rep(i, n) { cout << sum - y[i] * (n-1) << " "; } }