#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  vector<long long> permutation(const vector<int>& q, int n) {
    vector<long long> res = {0ll};
    long long minv = 0;
    for (int e : q) {
      minv = min(minv, res.back() + e);
      res.push_back(res.back() + e);
    }
    long long diff = 1 - minv;
    unordered_set<long long> visited;
    for (long long& e : res) {
      e += diff;
      assert(e >= 1);
      if (e > n || visited.count(e)) return {};
      visited.insert(e);
    }
    return res;
  }
};
int main() {
  int n;
  cin >> n;
  vector<int> q(n - 1);
  for (int i = 0; i < n - 1; i++) cin >> q[i];
  vector<long long> res = Solution().permutation(q, n);
  if (res.size()) {
    for (long long e : res) cout << e << " ";
    cout << endl;
  } else
    cout << -1 << endl;
  return 0;
}
