#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long maxu = 200005;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j, k = 0, n, t = 1, m, l = 0;
  while (t--) {
    cin >> n;
    long long b[n];
    long long f[n + n + 1];
    for (i = 0; i <= 2 * n; i++) f[i] = 0;
    b[0] = 0;
    for (i = 1; i < n; i++) {
      cin >> b[i];
    }
    long long mini = -1000000007;
    mini = b[0];
    for (i = 1; i < n; i++) {
      b[i] += b[i - 1];
      mini = min(mini, b[i]);
    }
    long long x = abs(mini) + 1;
    long long ans = 0;
    l = -1;
    bool y = true;
    for (i = 0; i < n; i++) {
      if (b[i] + x <= n)
        f[b[i] + x]++;
      else {
        y = false;
        break;
      }
    }
    for (i = 1; i <= n; i++) {
      if (f[i]) ans++;
    }
    if (ans < n || y == false) {
      cout << -1 << "\n";
    } else {
      for (i = 0; i < n; i++) {
        cout << x + b[i] << " ";
      }
      cout << "\n";
    }
  }
  return 0;
}
