#include<bits/stdc++.h>
using namespace std;
long long a[2000005],s[2000005],mmax[2000005];
int main()
{
    int n;
    cin>>n;
   long long sum=0;
    for (int i=1;i<=n;i++){
        cin>>a[i];
        sum-=1ll*(i-1)*mmax[i-1];
        mmax[i]=max(mmax[i-1],a[i]);
        s[i]=s[i-1]+a[i];
        sum+=i*mmax[i];
        sum+=s[i];
        cout<<sum<<endl;
    }
    return 0;
}

//#include <bits/stdc++.h>
//using namespace std;
#include <cstdio>

#define rep(i,_l,_r) for(signed i=(_l),_end=(_r);i<=_end;++i)
#define fep(i,_l,_r) for(signed i=(_l),_end=(_r);i>=_end;--i)
#define erep(i,u) for(signed i=head[u],v=to[i];i;i=nxt[i],v=to[i])
#define efep(i,u) for(signed i=Head[u],v=to[i];i;i=nxt[i],v=to[i])
#define print(x,y) write(x),putchar(y) 
//#define debug(...) do {cerr<<__LINE__<<" : ("#__VA_ARGS__<<") = "; Out(__VA_ARGS__); cerr<<flush;} while(0)
//template <typename T> void Out(T x) {cerr<<x<<"\n";}
//template <typename T,typename ...I> void Out(T x,I ...NEXT) {cerr<<x<<", "; Out(NEXT...);}

template <class T> inline T read(const T sample) {
    T x=0; int f=1; char s;
    while((s=getchar())>'9'||s<'0') if(s=='-') f=-1;
    while(s>='0'&&s<='9') x=(x<<1)+(x<<3)+(s^48),s=getchar();
    return x*f;
}
template <class T> inline void write(const T x) {
    if(x<0) return (void) (putchar('-'),write(-x));
    if(x>9) write(x/10);
    putchar(x%10^48);
}
template <class T> inline T Max(const T x,const T y) {if(x>y) return x; return y;}
template <class T> inline T Min(const T x,const T y) {if(x<y) return x; return y;}
template <class T> inline T fab(const T x) {return x>0?x:-x;}
template <class T> inline T gcd(const T x,const T y) {return y?gcd(y,x%y):x;}
template <class T> inline T lcm(const T x,const T y) {return x/gcd(x,y)*y;}
template <class T> inline T Swap(T &x,T &y) {x^=y^=x^=y;}

typedef long long ll;

const int maxn=2e5+5;

int n,a[maxn];
ll mx,sum,ans;

int main() {
	n=read(9);
	rep(i,1,n) a[i]=read(9);
	rep(i,1,n) {
		sum+=a[i],ans+=sum;
		mx=Max(mx,0ll+a[i]);
		print(1ll*mx*i+ans,'\n');
	}
	return 0;
}
