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