#include <bits/stdc++.h>
using namespace std;
vector<long long int> adj[100001];
set<long long int> s;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int power(long long int x, long long int y, long long int p) {
  long long int ans = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) ans = (ans * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return ans;
}
void solve() {
  long long int n, i, j, q, k, cnt = 0, mx = 0, sum = 0, left = 0, right = 0;
  long long int sum1 = 0, a, b, c, d, r;
  q = pow(10, 9) + 7;
  long long int t;
  cin >> n;
  vector<long long int> v(n);
  for (i = 0; i < n - 1; i++) cin >> v[i];
  int arr[n - 1];
  arr[0] = v[0];
  for (i = 1; i < n - 1; i++) arr[i] = arr[i - 1] + v[i];
  for (i = 0; i < n - 1; i++) sum += arr[i];
  q = (n * (n + 1)) / 2;
  q -= sum;
  vector<long long int> v1;
  if (q % n == 0) {
    q /= n;
    v1.push_back(q);
    for (i = 0; i < n - 1; i++) v1.push_back(q + arr[i]);
  } else {
    cout << "-1";
    return;
  }
  map<long long int, long long int> m;
  for (i = 0; i < n; i++) m[v1[i]]++;
  for (i = 1; i <= n; i++) {
    if (m[i] == 0) {
      cout << "-1";
      return;
    }
  }
  for (i = 0; i < n; i++) cout << v1[i] << " ";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int tt = 1.0 * clock();
  int t;
  t = 1;
  for (int y = 0; y < t; y++) {
    solve();
  }
  return 0;
}
