#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

typedef long long ll;

int main() {
    int N;
    scanf("%d", &N);
    vector<ll> A(N), S(N + 1, 0), M(N + 1, 0);
    rep(i, N) {
        scanf("%lld", &A[i]);
        S[i + 1] = S[i] + A[i];
        M[i + 1] = max(M[i], A[i]);
    }
    ll ans = 0;
    rep(i, N) {
        ans += S[i + 1];
        printf("%lld\n", ans + M[i + 1] * (i + 1));
    }
}
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  int i = 1;
  int sum = 0;
  while(true) {
    sum = sum + i;
    if (sum >= N) {
      cout << i << endl;
      return 0;
    }
    i++;
  }
}