#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    long long arr[n + 1];
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    long long barr[n + 1];
    barr[0] = arr[0];
    long long maxi = max((long long)0, arr[0]);
    for (int i = 1; i < n; i++) {
      barr[i] = arr[i] + maxi;
      maxi = max(maxi, barr[i]);
    }
    for (int i = 0; i < n; i++) {
      cout << barr[i] << " ";
    }
  }
}
