#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int a[n - 1];
  int b[n];
  int c[n];
  c[0] = 0;
  b[0] = 0;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d", &a[i]);
    b[i + 1] = b[i] + a[i];
    c[i + 1] = c[i] + a[i];
  }
  sort(b, b + n);
  int dif = b[0] - 1;
  for (int i = 0; i < n; i++) {
    if (b[i] != i + 1 + dif) {
      printf("-1");
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", c[i] - dif);
  }
}
