#include <bits/stdc++.h>
using namespace std;
long long int C(long long int n, long long int k) {
  long long int res = 1;
  for (long long int i = 1; i <= k; ++i) {
    res = res * (n - k + i) / i;
    res = res % 998244353;
  }
  return (long long int)(res);
}
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long int power(long long int base, long long int exp) {
  long long int res = 1;
  while (exp > 0) {
    if (exp % 2 == 1) res = (res * base) % 998244353;
    base = (base * base) % 998244353;
    exp /= 2;
  }
  return res % 998244353;
}
long double PI = acos(-1);
priority_queue<pair<long long int, long long int>,
               vector<pair<long long int, long long int> >,
               greater<pair<long long int, long long int> > >
    gq;
void ghost() {
  long long int i, j, k = 0, g = 0, t = 0, l = 0, n, m, r = 0, x, q;
  cin >> n;
  long long int b[n];
  k = -1;
  for (long long int i = 0; i < n; i++) cin >> b[i];
  long long int a[n];
  a[0] = b[0];
  for (long long int i = 1; i < n; i++) {
    t = max(t, a[i - 1]);
    a[i] = t + b[i];
    t = max(t, a[i]);
  }
  for (long long int i = 0; i < n; i++) cout << a[i] << " ";
}
signed main() {
  int test = 1;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  while (test--) ghost();
  return 0;
}
