#include <bits/stdc++.h>
#define rep(i, n) for (ll i=0; i<n; ++i)
#define all(obj) (obj).begin(),(obj).end()
#define MOD 1000000007
#define PI acos(-1)
#define INF = 1001001001;
using namespace std;
using Graph = vector<vector<long long>>;
typedef long long ll;
long long GCD(long long x, long long y) { return y ? GCD(y, x%y) : x; }

int main(){
    vector<int> abc(3);
    rep(i, 3) cin >> abc[i];
    sort(all(abc));
    cout << abc[2] + abc[1] << endl;
    return 0;
}

//#define LOCAL
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mem(a, b) memset(a,b,sizeof(a))
#define sz(a) (int)a.size()
#define INF 0x3f3f3f3f
#define DNF 0x7f7f7f7f
#define DBG printf("this is a input\n")
#define fi first
#define se second
#define PiL pair <ll , ll>
#define PLL pair <ll , ll>
#define pii pair <int , int>
#define mk(a, b) make_pair(a,b)
#define pb push_back
#define LF putchar('\n')
#define SP putchar(' ')
#define p_queue priority_queue
#define CLOSE ios::sync_with_stdio(0); cin.tie(0)

template<typename T>
void read(T &x) {x = 0;char ch = getchar();ll f = 1;while(!isdigit(ch)){if(ch == '-')f *= -1;ch = getchar();}while(isdigit(ch)){x = x * 10 + ch - 48; ch = getchar();}x *= f;}
template<typename T, typename... Args>
void read(T &first, Args& ... args) {read(first);read(args...);}
template<typename T>
void write(T arg) {T x = arg;if(x < 0) {putchar('-'); x =- x;}if(x > 9) {write(x / 10);}putchar(x % 10 + '0');}
template<typename T, typename ... Ts>
void write(T arg, Ts ... args) {write(arg);if(sizeof...(args) != 0) {putchar(' ');write(args ...);}}

using namespace std;

ll gcd(ll a, ll b) {
    return b == 0 ? a : gcd(b, a % b);
}

ll lcm(ll a, ll b) {
    return a / gcd(a, b) * b;
}

const int N = 2e5 + 5;
const int mod = 1e9 + 7;
int n, m, T;
ll a[N], sum[N], maxn[N], sum2[N];
int main()
{
    CLOSE;
    cin >> n;
    for (int i = 1 ;  i <= n ; i ++) cin >> a[i];
    for (int i = 1 ; i <= n ; i ++)
        sum[i] = sum[i-1] + a[i];
    for (int i = 1 ; i <= n ; i ++)
        sum[i] += sum[i-1];
    for (int i = 1 ; i <= n ; i ++) {
        maxn[i] = max(maxn[i - 1], a[i]);
    }
    for (int i = 1 ; i <= n ; i ++)
        cout << (1ll * i * maxn[i] + sum[i]) << endl;






}