#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int main() {
  int n, i, j, k, q[N] = {0}, p[N], minn = (1 << 30);
  set<int> s;
  cin >> n;
  for (i = 1; i < n; i++) {
    scanf("%d", &q[i]);
    q[i] += q[i - 1];
    if ((s.find(q[i]) != s.end()) || q[i] == 0) {
      cout << -1 << endl;
      return 0;
    }
    s.insert(q[i]);
    minn = min(minn, q[i]);
  }
  if (minn > 0) {
    p[1] = 1;
    for (i = 2; i <= n; i++) {
      p[i] = 1 + q[i - 1];
      if (p[i] < 2 || p[i] > n) {
        cout << -1 << endl;
        return 0;
      }
    }
  } else {
    p[1] = 1 - minn;
    if (p[1] < 1 || p[1] > n) {
      cout << -1 << endl;
      return 0;
    }
    for (i = 2; i <= n; i++) {
      p[i] = p[1] + q[i - 1];
      if (p[i] < 1 || p[i] > n) {
        cout << -1 << endl;
        return 0;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    printf("%d%c", p[i], i == n ? '\n' : ' ');
  }
  return 0;
}
