#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  t = 1;
  for (; t; t--) {
    int n;
    cin >> n;
    int res[n];
    res[0] = 1;
    int mn = 1, mx = 1;
    set<int> s;
    s.insert(res[0]);
    int arr[n - 1];
    for (int i = 0; i < n - 1; i++) {
      cin >> arr[i];
      res[i + 1] = arr[i] + res[i];
      mn = min(mn, res[i + 1]);
      mx = max(mx, res[i + 1]);
      s.insert(res[i + 1]);
    }
    if (s.size() != n || mx - mn != n - 1) {
      cout << "-1";
    } else {
      for (int i = 0; i < n; i++) {
        cout << res[i] + 1 - mn << " ";
      }
    }
    cout << "\n";
  }
  return 0;
}
