#include <iostream>
#include <algorithm>
#define REP(i, a, n) for(int (i) = (a); (i) <= (n); (i)++)
using namespace std;
typedef pair<long, int> PAIR;

const int SIZE = 100001;
int N;
PAIR A[SIZE];

int main(void) {
  cin >> N;
  REP(i, 1, N) {
    cin >> A[i].first;
    A[i].second = i;
  }

  sort(A + 1, A + N + 1);
  reverse(A + 1, A + N + 1);

  long ans[SIZE];
  REP(i, 1, N) ans[i] = 0;

  int m = SIZE;
  REP(i, 1, N) {
    long diff = i != N ? A[i].first - A[i + 1].first : A[i].first;
    m = min(m, A[i].second);
    ans[m] += i * diff;
  }

  REP(i, 1, N) cout << ans[i] << endl;

  return 0;
}
