#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
const int maxn = 200010;
int n, b[maxn], a[maxn], MAX = 0;
int main() {
  n = read();
  for (int i = 1; i <= n; i++) b[i] = read();
  a[1] = b[1];
  MAX = a[1];
  for (int i = 2; i <= n; i++) {
    a[i] = MAX + b[i];
    if (b[i] > 0) MAX = a[i];
  }
  for (int i = 1; i < n; i++) printf("%d ", a[i]);
  printf("%d\n", a[n]);
  return 0;
}
