#include <bits/stdc++.h>
using namespace std;
bool prime(long long n) {
  for (long long i = 2; i <= sqrt(n); i++)
    if (n % i == 0) return false;
  return true;
}
bool isPermutation(vector<long long> a, int n) {
  vector<bool> visited(n + 1, false);
  visited[0] = true;
  for (int i = 0; i < n; i++) {
    if (a[i] > n) return false;
    visited[a[i]] = true;
  }
  bool flag = 1;
  for (bool el : visited) flag &= el;
  return flag;
}
void solve() {
  int n;
  cin >> n;
  vector<long long> a(n - 1);
  vector<long long> x;
  x.push_back(0);
  long long mn = 0;
  for (auto &el : a) {
    cin >> el;
    mn = min(mn, x.back() + el);
    x.push_back(x.back() + el);
  }
  for (int i = 0; i < x.size(); i++) {
    x[i] += (abs(mn) + 1);
  }
  if (isPermutation(x, n)) {
    for (auto &el : x) cout << el << " ";
    cout << endl;
  } else {
    cout << -1 << endl;
  }
}
int main() { solve(); }
