#include #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector y(n); ll sm = 0; rep(i, n){ cin >> y[i]; sm += y[i]; } rep(i, n) cout << sm - (n - 1) * y[i] << (i == n - 1 ? "\n" : " "); }