#include <bits/stdc++.h>
using namespace std;
void setIn(string s) { freopen(s.c_str(), "r", stdin); }
void setOut(string s) { freopen(s.c_str(), "w", stdout); }
int main() {
  int n;
  cin >> n;
  vector<int> q;
  for (int i = 0; i < n - 1; i++) {
    int x;
    cin >> x;
    q.push_back(x);
  }
  vector<int> prefix;
  int prefixinit = q[0];
  prefix.push_back(prefixinit);
  for (int i = 1; i < n - 1; i++) {
    prefixinit += q[i];
    prefix.push_back(prefixinit);
  }
  sort(prefix.begin(), prefix.end());
  int start = 1;
  if (prefix[0] < 0) {
    start = 1 - prefix[0];
  }
  vector<int> p;
  p.push_back(start);
  for (int i = 0; i < n - 1; i++) {
    start += q[i];
    p.push_back(start);
  }
  map<int, int> fw;
  bool flag = true;
  for (int i = 0; i < n; i++) {
    if (p[i] >= 1 && p[i] <= n && fw[p[i]] == 0) {
      fw[p[i]]++;
    } else {
      flag = false;
    }
  }
  if (!flag) {
    cout << -1 << endl;
  } else {
    for (int i = 0; i < n; i++) {
      cout << p[i] << " ";
    }
    cout << endl;
  }
}
