#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int *arr = new int[n];
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] > 0) sum += arr[i];
  }
  int *val = new int[n];
  val[0] = arr[0];
  int macval = arr[0];
  for (int i = 1; i < n; i++) {
    val[i] = macval + arr[i];
    if (macval < val[i]) macval = val[i];
  }
  for (int k = 0; k < n; k++) cout << val[k] << " ";
}
