#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, sum = 0, d = 0, max = 0;
  cin >> n;
  vector<int> a(n), q(n - 1), c(n);
  for (i = 0; i < n - 1; i++) {
    cin >> q[i];
  }
  for (i = 0; i < n - 1; i++) {
    sum = sum + q[i];
    if (max < sum) max = sum;
  }
  if (max == -1) {
    a[0] = n;
    for (i = 0; i < n - 1; i++) a[i + 1] = a[i] + q[i];
  } else {
    a[0] = n - max;
    for (i = 0; i < n - 1; i++) a[i + 1] = a[i] + q[i];
  }
  for (i = 0; i < n; i++) c[i] = a[i];
  sort(c.begin(), c.end());
  for (i = 0; i < n; i++) {
    if (c[i] != (i + 1)) break;
  }
  if (i < n) cout << "-1" << endl;
  if (i == n) {
    for (i = 0; i < n; i++) cout << a[i] << " ";
  }
}
