#include <bits/stdc++.h>
using namespace std;
long long a[2000000];
long long x[2000000];
long long b[2000000];
long long MAX(long long a, long long b) {
  if (a >= b) return a;
  return b;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> b[i];
  a[0] = b[0];
  x[1] = MAX(0, a[0]);
  a[1] = b[1] + x[1];
  for (int i = 2; i < n; i++) {
    x[i] = MAX(x[i - 1], a[i - 1]);
    a[i] = b[i] + x[i];
  }
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  cout << "\n";
}
