#include<bits/stdc++.h>

#define maxn 100005

using namespace std;
typedef long long ll;

int main(){


  ios_base::sync_with_stdio(0);

  int n;
  cin >> n;

  vector < pair < int, int > > a(n);

  for (int i = 0; i < n; ++i) {
    cin >> a[i].first;
    a[i].second = i;
  }

  vector < ll > ans(n);

  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());

  int id = n;

  a.push_back({0, -1});

  for (int i = 0; i < n; ++i) {
    id = min(id, a[i].second);

    if (id >= a[i].second)
      ans[a[i].second] = 1ll * (a[i].first - a[i + 1].first) * (i + 1);
  }

  for (auto i : ans)
    cout << i << '\n';

  return 0;

}
