#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 0;
  long long n, i, j, k, c = 0, s = 0;
  cin >> n;
  long long a[n + 1];
  vector<long long> v, v1;
  a[0] = 0;
  set<long long> st;
  for (i = 1; i < n; i++) {
    cin >> a[i];
    a[i] += a[i - 1];
  }
  long long mn = *min_element(a, a + n);
  s = 1 - mn;
  for (i = 0; i < n; i++) {
    a[i] += s;
    st.insert(a[i]);
  }
  if (st.size() < n) {
    cout << -1;
    return 0;
  }
  for (i = 0; i < n; i++) {
    if (a[i] > n || a[i] == 0) {
      cout << -1;
      return 0;
    }
  }
  for (i = 0; i < n; i++) cout << a[i] << " ";
}
