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