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

int n;
vector<long long> a;

int main() {
  cin >> n;
  a.resize(n);
  long long sum = 0, num = 0, res = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    num = max(a[i], num);
    res += a[i];
    res += sum;
    sum += a[i];
    cout << num * (i + 1) + res << endl;
  }
  return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define reg register
#define For(i,a,b) for(reg int i=a;i<=b;++i)
#define Down(i,a,b) for(reg int i=a;i>=b;--i) 
#define ull unsigned long long
#define ll long long
inline int max(int x,int y){return x>y?x:y;}
inline int min(int x,int y){return x<y?x:y;}
inline int gcd(int n,int m){return m?gcd(m,n%m):n;}
inline int lcm(int x,int y){return x/gcd(x,y)*y;}
inline void swap(int &x,int &y){int t=x; x=y; y=t; return ;}
namespace yspm{
	inline int read(){
	    int res=0,f=1; char k;
	    while(!isdigit(k=getchar())) if(k=='-') f=-1;
	    while(isdigit(k)) res=res*10+k-'0',k=getchar();
	    return res*f;
    }
    const int N=2e5+10;
    int a[N],sum[N],n;
    
	signed main(){
	    n=read(); For(i,1,n) sum[i]=sum[i-1]+(a[i]=read());
	    int Sum=0,mx=0;
	    for(reg int i=1;i<=n;++i){
	        mx=max(mx,a[i]); Sum+=sum[i];
	        printf("%lld\n",mx*i+Sum);
	    }
		return 0;
    }
}signed main(){return yspm::main();}
//Use The Time To Enrich This Selfclosing Youth