#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;
    vector<int> a(n);
    for (auto &i : a) cin >> i;
    vector<int> ans(n, 0);
    ans[0] = a[0];
    int maxi = max(0, a[0]);
    for (int i = 1; i < n; ++i) {
      ans[i] = a[i] + maxi;
      maxi = max(maxi, ans[i]);
    }
    for (int i : ans) cout << i << " ";
  }
  return 0;
}
