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