#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> ar(n);
  for (int i = 0; i < n; i++) cin >> ar[i];
  long long cur = ar[0], Max = ar[0];
  cout << cur << " ";
  for (int i = 1; i < n; i++) {
    cur += ar[i];
    cout << cur << " ";
    if (cur < Max)
      cur = Max;
    else
      Max = cur;
  }
  cout << endl;
}
