#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, sum = 0, k, a;
  cin >> n;
  vector<long long> q(n - 1);
  vector<long long> p(n);
  vector<long long> r(n);
  for (i = 0; i < n - 1; i++) {
    cin >> q[i];
    sum += (n - 1 - i) * q[i];
  }
  k = n * (n + 1) / 2;
  a = (k - sum) / n;
  if (floor(a) != ceil(a))
    cout << "-1" << endl;
  else {
    p[0] = a;
    for (i = 1; i < n; i++) p[i] = q[i - 1] + p[i - 1];
    r = p;
    sort(r.begin(), r.end());
    for (i = 1; i <= n; i++)
      if (r[i - 1] != i) {
        cout << "-1" << endl;
        return 0;
      }
    for (i = 0; i < n; i++) cout << p[i] << " ";
    cout << endl;
  }
}
