#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7fffffff;
int n, t, a[200020], b[200020];
int main() {
  scanf("%d", &n);
  a[0] = 0;
  for (int i = 1; i < n; i++) {
    scanf("%d", &t);
    a[i] = a[i - 1] + t;
  }
  int minn = INF;
  for (int i = 0; i < n; i++) {
    minn = min(minn, a[i]);
  }
  int add = 1 - minn;
  for (int i = 0; i < n; i++) a[i] += add, b[i] = a[i];
  sort(b, b + n);
  int ok = 1;
  for (int i = 0; i < n; i++) {
    if (b[i] != i + 1) {
      ok = 0;
      break;
    }
  }
  if (ok) {
    for (int i = 0; i < n; i++) {
      if (i == 0)
        printf("%d", a[i]);
      else
        printf(" %d", a[i]);
    }
  } else
    printf("-1");
  return 0;
}
