#include <bits/stdc++.h>
using namespace std;
map<long long, long long> cnt;
long long n, ttl = 0;
long long p[200009], sum[200009], q[200009];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 1; i < n; i++) {
    cin >> p[i];
    sum[i] = p[i] + sum[i - 1];
  }
  long long k = n * (n + 1) / 2;
  for (long long i = 1; i < n; i++) {
    ttl += sum[i];
  }
  if ((k - ttl) % n != 0) {
    cout << "-1";
    return 0;
  }
  q[1] = (k - ttl) / n;
  for (long long i = 2; i <= n; i++) {
    q[i] = q[i - 1] + p[i - 1];
  }
  for (long long i = 1; i <= n; i++) {
    cnt[q[i]]++;
  }
  for (long long i = 1; i <= n; i++) {
    if (cnt[q[i]] > 1) {
      cout << "-1";
      return 0;
    }
    if (q[i] > n || q[i] < 1) {
      cout << "-1";
      return 0;
    }
  }
  for (long long i = 1; i <= n; i++) {
    cout << " " << q[i];
  }
  return 0;
}
