// Copyright (C) 2017 Sayutin Dmitry.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; version 3

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; If not, see <http://www.gnu.org/licenses/>.

#include <iostream>
#include <vector>
#include <stdint.h>
#include <algorithm>
#include <set>
#include <map>
#include <array>
#include <queue>
#include <stack>
#include <functional>
#include <utility>
#include <string>
#include <assert.h>
#include <iterator>
#include <cstdint>
#include <cinttypes>

using std::cin;
using std::cout;
using std::cerr;

using std::vector;
using std::map;
using std::array;
using std::set;
using std::string;

using std::pair;
using std::make_pair;

using std::min;
using std::abs;
using std::max;

using std::unique;
using std::sort;
using std::generate;
using std::reverse;
using std::min_element;
using std::max_element;

#ifdef LOCAL
#define LASSERT(X) assert(X)
#else
#define LASSERT(X) {}
#endif

template <typename T>
T input() {
    T res;
    cin >> res;
    LASSERT(cin);
    return res;
}

template <typename IT>
void input_seq(IT b, IT e) {
    std::generate(b, e, input<typename std::remove_reference<decltype(*b)>::type>);
}

#define SZ(vec)         int((vec).size())
#define ALL(data)       data.begin(),data.end()
#define RALL(data)      data.rbegin(),data.rend()
#define TYPEMAX(type)   std::numeric_limits<type>::max()
#define TYPEMIN(type)   std::numeric_limits<type>::min()


const int maxn = 1e5 + 228;

vector<int> tree[4 * maxn];
vector<int64_t> tree2[4 * maxn];
vector<int> in;

void build(int node, int node_l, int node_r) {
    if (node_l == node_r - 1)
        tree[node] = {in[node_l]};
    else {
        int mid = node_l + (node_r - node_l) / 2;
        build(2 * node + 1, node_l, mid);
        build(2 * node + 2, mid, node_r);

        tree[node].resize(node_r - node_l);
        std::merge(ALL(tree[2 * node + 1]), ALL(tree[2 * node + 2]), tree[node].begin());
    }
    
    tree2[node].resize(node_r - node_l + 1);
    for (int i = 0; i != node_r - node_l; ++i)
        tree2[node][1 + i] = tree2[node][i] + tree[node][i];
}

int64_t count(int node, int node_l, int node_r, int l, int r, int x0, int x1) {
    if (l <= node_l and node_r <= r) {
        int p0 = std::lower_bound(ALL(tree[node]), x0) - tree[node].begin();
        int p1 = std::upper_bound(ALL(tree[node]), x1) - tree[node].begin();
        return (tree2[node][p1] - tree2[node][p0]) - (x0 - 1) * 1ll * (p1 - p0) + (SZ(tree[node]) - p1) * 1ll * (x1 - x0 + 1);
    }
    if (node_r <= l or r <= node_l)
        return 0;
    int mid = node_l + (node_r - node_l) / 2;
    return count(2 * node + 1, node_l, mid, l, r, x0, x1)
         + count(2 * node + 2, mid, node_r, l, r, x0, x1);
}

int main() {
    std::iostream::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    
    // code here.
    in.resize(input<int>());
    input_seq(ALL(in));

    build(0, 0, SZ(in));

    int mx = 0;
    for (int i = 0; i != SZ(in); ++i) {
        int64_t ans = 0;
        if (in[i] > mx) {
            ans = count(0, 0, SZ(in), i, SZ(in), mx + 1, in[i]);
            mx = in[i];
        }
        
        cout << ans << "\n";
    }

    
    return 0;
}


Measured memory_bytes: 49792