#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[200005];
long long b[200005];
int main() {
  while (~scanf("%lld", &n)) {
    int flag = 0;
    int flag1 = 0;
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    for (int i = 1; i < n; i++) {
      scanf("%lld", &a[i]);
      a[i] = a[i - 1] + a[i];
      b[i] = a[i];
    }
    sort(a + 1, a + n);
    for (int i = 1; i < n - 1; i++) {
      if (a[i] == 0) {
        printf("-1\n");
        flag1 = 1;
        break;
      }
      if (a[i] == a[i + 1]) {
        printf("-1\n");
        flag1 = 1;
        break;
      }
    }
    if (flag1) break;
    if (a[1] < 0 && a[n - 1] < 0 && a[1] * -1 < n) {
      int t;
      t = n;
      printf("%lld", t);
      for (int i = 1; i < n; i++) {
        printf(" %lld", t + b[i]);
      }
      printf("\n");
      flag = 1;
    }
    if (a[1] > 0 && a[n - 1] > 0 && a[n - 1] < n) {
      int t;
      t = 1;
      printf("%lld", t);
      for (int i = 1; i < n; i++) {
        printf(" %lld", t + b[i]);
      }
      printf("\n");
      flag = 1;
    }
    if (a[1] < 0 && a[n - 1] > 0 && a[n - 1] - a[1] < n) {
      int t;
      t = n - a[n - 1];
      printf("%lld", t);
      for (int i = 1; i < n; i++) {
        printf(" %lld", t + b[i]);
      }
      printf("\n");
      flag = 1;
    }
    if (flag == 0) {
      printf("-1\n");
    }
  }
  return 0;
}
