#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  cin >> n;
  int arr[n + 5];
  long long mn = 0;
  long long sm = 0;
  for (i = 0; i < (n - 1); i++) {
    cin >> arr[i];
    sm += arr[i];
    if (sm < mn) mn = sm;
  }
  long long p[n + 5];
  mn = 1 - mn;
  p[0] = mn;
  bool chk = true;
  for (i = 0; i < n - 1; i++) {
    p[i + 1] = p[i] + arr[i];
  }
  for (i = 0; i < n; i++) {
    if (p[i] < 1 || p[i] > n) chk = false;
  }
  if (chk) {
    set<long long> ans(p, p + n);
    int sz = ans.size();
    if (ans.size() == n)
      chk = true;
    else
      chk = false;
    if (chk) {
      for (i = 0; i < n; i++) {
        cout << p[i] << " ";
      }
    } else {
      cout << -1 << endl;
    }
  } else
    cout << -1 << endl;
  return 0;
}
