#include <bits/stdc++.h>
using namespace std;
long long ans[200009];
long long ara[200009];
int main() {
  set<long long> st;
  long long n;
  cin >> n;
  long long mn = 0;
  long long pos = 0;
  long long sum = 0;
  for (long long i = 1; i < n; i++) {
    cin >> ara[i];
    sum += ara[i];
    mn = min(mn, sum);
  }
  ans[0] = -mn + 1;
  st.insert(ans[0]);
  if (ans[0] > n) {
    cout << -1 << endl;
    return 0;
  }
  for (long long i = 1; i < n; i++) {
    ans[i] = ans[i - 1] + ara[i];
    if (st.count(ans[i]) == 1 || ans[i] > n) {
      cout << -1 << endl;
      return 0;
    }
    st.insert(ans[i]);
  }
  cout << ans[0];
  for (long long i = 1; i < n; i++) cout << " " << ans[i];
  cout << endl;
}
