#include #include #include #include #include #include #include #include using namespace std; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } using ll = long long; const long long MOD = 1e9+7; int main() { int n; cin >> n; vector y(n); ll sum = 0; for (int i = 0; i < n; i++) { cin >> y.at(i); sum += y.at(i); } for (int i = 0; i < n; i++) { ll x = sum - y.at(i) * (n - 1); cout << x << " "; } cout << endl; }