#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, b[200020], a[200020], maxi;
  cin >> n;
  for (long long int i = 0; i < (n); i++) cin >> b[i];
  a[0] = b[0];
  maxi = max((long long int)0, a[0]);
  for (long long int i = 1; i < (n); i++) {
    a[i] = b[i] + maxi;
    maxi = (max(a[i], maxi));
  }
  for (long long int i = 0; i < (n); i++) cout << a[i] << " ";
}
