#include #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define ll long long #define INF 1000000000000000000 int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector y(N); ll sum = 0; rep(i, N) { cin >> y[i]; sum += y[i] * (N - 1); } sum /= 2; rep(i, N) { cout << sum - y[i] * (N - 1) << " "; } cout << endl; }