#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const int inf = (int)1e9;
const long long linf = (long long)1e18 + 1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  long long q[n - 1];
  long long p[n];
  bool arr[n];
  for (int i = 0; i < n - 1; i++) cin >> q[i];
  long long sum[n - 1];
  sum[0] = q[0];
  for (int i = 1; i < n - 1; i++) sum[i] = sum[i - 1] + q[i];
  long long s = 0ll;
  for (int i = 0; i < n - 1; i++) s += sum[i];
  long long t = n * 1ll * (n + 1) / 2;
  t -= s;
  if (t % n == 0) {
    t /= n;
    p[0] = t;
    for (int i = 1; i < n; i++) p[i] = p[0] + sum[i - 1];
    bool arr[n];
    for (int i = 0; i < n; i++) arr[i] = 0;
    for (int i = 0; i < n; i++) {
      if (p[i] <= 0 || p[i] > n || arr[p[i] - 1]) {
        cout << -1;
        return 0;
      }
      arr[p[i] - 1] = 1;
    }
    for (int i = 0; i < n; i++) cout << p[i] << " ";
    return 0;
  }
  cout << -1;
  return 0;
}
