#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.141593;
const long long mod = 1000000007;
const long long INF = 1e15;
const long long nax = 1e5 + 5;
long long dx[] = {0, 0, 1, -1};
long long dy[] = {1, -1, 0, 0};
string ds = "RLDU";
long long parent[200001] = {0};
long long size[200001] = {0};
vector<long long> adj[1000000];
int32_t main() {
  long long n, f = 0;
  cin >> n;
  vector<long long> a(n - 1), b(n), c(n - 1);
  long long sum = (n * (n + 1)) / 2;
  for (long long i = 0; i < n - 1; i++) cin >> a[i];
  c[n - 2] = a[n - 2];
  for (long long i = n - 3; i >= 0; i--) c[i] = a[i] + c[i + 1];
  for (long long i = 0; i < n - 1; i++) sum += c[i];
  b[n - 1] = sum / n;
  map<long long, long long> M;
  M[b[n - 1]]++;
  if (b[n - 1] < 1 || b[n - 1] > n) f = -1;
  for (long long i = n - 2; i >= 0; i--) {
    b[i] = b[n - 1] - c[i];
    M[b[i]]++;
    if (b[i] < 1 || b[i] > n) f = -1;
    if (M[b[i]] > 1) f = -1;
  }
  if (f)
    cout << -1 << "\n";
  else {
    for (auto i : b) cout << i << " ";
  }
}
