#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)s; i < (int)e; ++i) #define all(a) (a).begin(), (a).end() int main() { cin.tie(nullptr); int N; cin >> N; vector y(N); ll sum = 0; rep(i, 0, N) { cin >> y[i]; sum += y[i]; } rep(i, 0, N) { cout << sum - y[i] * (N - 1); if (i == N - 1) cout << '\n'; else cout << ' '; } }