#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; using vi = vector; using vii = vector; using vl = vector; using vll = vector; #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) { debug(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() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector y(n); ll sum = 0; rep(i, n) { cin >> y[i]; sum += y[i]; } rep(i, n) { cout << sum - (n-1)*y[i] << " "; } cout << endl; }