#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int n;
  cin >> n;
  vector<int> q(n - 1);
  for (auto &x : q) {
    cin >> x;
  }
  vector<int> v(n);
  v[0] = 0;
  for (int i = 1; i < n; ++i) {
    v[i] = v[i - 1] + q[i - 1];
  }
  int inc = 1 - *min_element(v.begin(), v.end());
  for (auto &x : v) {
    x += inc;
  }
  set<int> s(v.begin(), v.end());
  for (int i = 1; i <= n; ++i) {
    if (s.count(i) == 0) {
      cout << -1 << '\n';
      return 0;
    }
  }
  for (int i = 0; i < n; ++i) {
    if (i) cout << " ";
    cout << v[i];
  }
  cout << '\n';
  return 0;
}
