#include <bits/stdc++.h>
using namespace std;
long long a[1000000], b[1000000];
signed main() {
  long long n, sum = 0;
  map<long long, long long> date;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
    sum += a[i];
  }
  sort(a, a + n);
  long long msum = a[0];
  for (long long i = 0; i < n; i++) {
    date[a[i]] = sum - msum;
    msum += a[i + 1];
  }
  for (long long i = 0; i < n; i++) {
    cout << date[b[i]];
    if (i != n - 1) cout << " ";
  }
  cout << "\n";
}
