#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
long long a[MAXN];
map<long long, int> b;
int main() {
  int n, v;
  cin >> n;
  a[0] = 0;
  long long sum = 0, mmin = 0;
  for (int i = 2; i <= n; i++) {
    cin >> v;
    a[i] = a[i - 1] + v;
    sum += a[i];
    mmin = min(mmin, a[i]);
  }
  for (int i = 1; i <= n; i++) {
    a[i] = a[i] - mmin + 1;
    if (b[a[i]] == 1 || a[i] > n) {
      cout << -1 << endl;
      return 0;
    }
    b[a[i]] = 1;
  }
  for (int i = 1; i <= n; i++) cout << a[i] << ' ';
  cout << endl;
  return 0;
}
