#include <bits/stdc++.h>
#pragma optimize("O3")
using namespace std;
long long const N = 2e5 + 2;
long long k, b, d, q, w, x;
long long m, n, a[N], aa[N], aaa[N];
bool us[N];
char ch;
string t;
int main() {
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> a[i];
    q += a[i];
    d = max(d, q);
  }
  aa[1] = n - d;
  for (int i = 2; i <= n; i++) {
    aa[i] = aa[i - 1] + a[i - 1];
  }
  for (int i = 1; i <= n; i++) {
    aaa[i] = aa[i];
    if (aa[i] < 1 || aa[i] > n) return cout << -1, 0;
  }
  sort(aaa + 1, aaa + n + 1);
  for (int i = 1; i <= n; i++) {
    if (aaa[i] != i) return cout << -1, 0;
  }
  for (int i = 1; i <= n; i++) {
    cout << aa[i] << " ";
  }
}
