#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
long long n, k, m, t, x, b[N], a[N];
int i, j;
map<int, long long> C;
int main() {
  cin >> n;
  for (i = 2; i <= n; i++) {
    cin >> a[i];
    a[i] += a[i - 1];
    m = min(m, a[i]);
  }
  x = 1 - m;
  for (i = 1; i <= n; i++) {
    a[i] += x;
    if (a[i] < 1 || a[i] > n || b[a[i]] == 1) {
      cout << -1;
      return 0;
    }
    b[a[i]] = 1;
  }
  for (i = 1; i <= n; i++) cout << a[i] << " ";
}
