#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
int n;
int a[maxn];
int w[maxn];
int cs[maxn];
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d", &a[i]);
  }
  int minn = 0;
  for (int i = 1; i < n; i++) {
    w[i] = a[i - 1] + w[i - 1];
    minn = min(minn, w[i]);
  }
  minn = abs(minn);
  int flag = 0;
  for (int i = 0; i < n; i++) {
    w[i] += minn + 1;
    if (w[i] <= 0 || w[i] > n) {
      flag = 1;
      break;
    }
    cs[w[i]]++;
    if (cs[w[i]] != 1) {
      flag = 1;
      break;
    }
  }
  if (flag == 1)
    printf("-1\n");
  else {
    for (int i = 0; i < n; i++) {
      if (i != 0) printf(" ");
      printf("%d", w[i]);
    }
    printf("\n");
  }
  return 0;
}
