#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 123, MAXN = 1e7, MEGAINF = 1e18 + 228;
template <class T>
inline istream& operator>>(istream& in, vector<T>& a) {
  for (auto& i : a) in >> i;
  return in;
}
template <class T>
inline ostream& operator<<(ostream& out, vector<T>& a) {
  for (auto i : a) out << i << " ";
  return out;
}
template <class T, class U>
inline istream& operator>>(istream& in, vector<pair<T, U>>& a) {
  for (auto& i : a) in >> i.first >> i.second;
  return in;
}
template <class T, class U>
inline ostream& operator<<(ostream& out, vector<pair<T, U>>& a) {
  for (auto& i : a) out << i.first << " " << i.second << "\n";
  return out;
}
signed main() {
  setlocale(LC_ALL, "rus");
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> q(n - 1);
  cin >> q;
  vector<long long> pref(n - 1);
  pref[0] = q[0];
  for (long long i = 1; i < n - 1; ++i) pref[i] = pref[i - 1] + q[i];
  long long mx = max(*max_element(pref.begin(), pref.end()), 0ll);
  long long delta = n - mx;
  vector<long long> a(n);
  a[0] = delta;
  for (long long i = 1; i < n; ++i) a[i] = pref[i - 1] + delta;
  set<long long> have(a.begin(), a.end());
  if (have.size() == n && *have.begin() == 1 && *have.rbegin() == n)
    cout << a;
  else
    cout << "-1";
}
