#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n;
long long q[N], sum[N];
long long p[N], p1[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) scanf("%I64d", &q[i]);
  sum[1] = 0;
  for (int i = 2; i <= n; i++) sum[i] = sum[i - 1] + q[i - 1];
  long long min_x = sum[1];
  for (int i = 2; i <= n; i++) min_x = min(min_x, sum[i]);
  long long x = -min_x + 1;
  for (int i = 1; i <= n; i++) p[i] = (long long)x + sum[i];
  for (int i = 1; i <= n; i++)
    if (p[i] > n) {
      puts("-1");
      return 0;
    }
  for (int i = 1; i <= n; i++) p1[i] = p[i];
  sort(p + 1, p + 1 + n);
  for (int i = 2; i <= n; i++)
    if (p[i] == p[i - 1]) {
      puts("-1");
      return 0;
    }
  for (int i = 1; i <= n; i++) printf("%I64d ", p1[i]);
  return 0;
}
