#include <bits/stdc++.h>
using namespace std;
int n;
long long q[200008];
long long qsum[200008];
long long ans[200008];
long long flag[200008];
int main() {
  scanf("%d", &n);
  long long mm = 0x3f3f3f3f3f3f3f3fLL;
  for (int i = 1; i < n; ++i) {
    scanf("%I64d", &q[i]);
    qsum[i] = qsum[i - 1] + q[i];
    mm = min(mm, qsum[i]);
  }
  if (mm > 0) {
    mm = 0;
  }
  mm = abs(mm);
  ans[1] = mm + 1;
  if (ans[1] > n || ans[1] <= 0 || flag[ans[1]]) {
    printf("-1\n");
    return 0;
  }
  flag[mm + 1] = 1;
  for (int i = 1; i < n; ++i) {
    ans[i + 1] = qsum[i] + mm + 1;
    if (ans[i + 1] > n || ans[i + 1] <= 0 || flag[ans[i + 1]]) {
      printf("-1\n");
      return 0;
    }
    flag[ans[i + 1]]++;
  }
  for (int i = 1; i <= n; ++i) {
    printf("%I64d ", ans[i]);
  }
  printf("\n");
}
