#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
long long MOD = 1e9 + 7;
long long n, ans = 0, m, x, y, k, mini = 0;
vector<long long> v[N], u[N];
long long a[N], b, cnt, d, j, i;
map<long long, long long> mp;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> a[i];
    a[i] += a[i - 1];
    mini = min(mini, a[i]);
  }
  long long x = 1 - mini;
  for (int i = 0; i < n; i++) {
    if (a[i] + x < 1 || a[i] + x > n) return cout << -1, 0;
    a[i] += x;
    mp[a[i]]++;
  }
  for (int i = 0; i < n; i++) {
    if (mp[a[i]] > 1) return cout << -1, 0;
  }
  for (int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
}
