#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool is_diverse(vector<T>& a) {
  int n = a.size();
  set<T> se(a.begin(), a.end());
  return se.size() == n && (*--se.end() - *se.begin()) == n - 1;
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
  for (auto& vi : vec) os << vi << " ";
  return os;
}
int main() {
  int n;
  cin >> n;
  vector<int> q(n - 1);
  for (int& qi : q) cin >> qi;
  vector<int> p(n);
  for (int i = 0; i < n - 1; i++) p[i + 1] = p[i] + q[i];
  if (!is_diverse(p)) return !(cout << -1 << endl);
  int ofs = *min_element(p.begin(), p.end());
  for (int i = 0; i < n; i++) p[i] += 1 - ofs;
  cout << p << endl;
  return 0;
}
