#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, min, max, cur = 0;
  cin >> n;
  vector<pair<int, int>> v(n);
  set<int> s;
  s.insert(0);
  for (int i = 0; i < n - 1; i++) {
    cin >> v[i].first;
  }
  v[0].second = 0;
  min = v[0].second;
  max = v[0].second;
  for (int i = 0; i < n - 1; i++) {
    cur += v[i].first;
    v[i + 1].second = cur;
    s.insert(cur);
    if (cur < min) {
      min = cur;
    }
    if (cur > max) {
      max = cur;
    }
  }
  if (s.size() < n || max - min != n - 1) {
    cout << -1;
    return 0;
  } else
    for (int i = 0; i < n; i++) cout << v[i].second - min + 1 << " ";
}
