#include <bits/stdc++.h>
using namespace std;
template <typename T>
istream &operator>>(istream &is, vector<T> &arr);
template <typename T>
ostream &operator<<(ostream &os, vector<T> &arr);
int main() {
  int n;
  cin >> n;
  vector<int> q(n - 1);
  cin >> q;
  long long sum = 0, mmin = 0;
  for (int i = 0; i < n - 1; i++) {
    sum += q[i];
    mmin = min(sum, mmin);
  }
  vector<long long> p(n);
  p[0] = 1 - mmin;
  for (int i = 0; i < n - 1; i++) {
    p[i + 1] = p[i] + q[i];
  }
  vector<int> count(n + 1, false);
  bool isP = true;
  for (int i = 0; i < n && isP; i++) {
    if (p[i] < 1 || p[i] > n || count[p[i]])
      isP = false;
    else
      count[p[i]] = true;
  }
  if (isP) {
    for (int i = 0; i < n; i++) cout << p[i] << ' ';
  } else
    cout << -1;
  cout << endl;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &arr) {
  typename vector<T>::iterator a;
  for (a = arr.begin(); a != arr.end(); a++) {
    is >> *a;
  }
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &arr) {
  typename vector<T>::iterator a;
  for (a = arr.begin(); a != arr.end(); a++) {
    os << *a << " ";
  }
  os << endl;
  return os;
}
