#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 5;
vector<int> A(MAX), B(MAX);
int n;
set<int> s;
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) cin >> A[i];
  for (int i = 1; i < n - 1; i++) A[i] += A[i - 1];
  int minimum = *min_element(A.begin(), A.end());
  B[0] = 1 - min(0, minimum);
  for (int i = 1; i < n; i++)
    B[i] = B[i - 1] + A[i - 1] - (i >= 2 ? A[i - 2] : 0);
  vector<int> temp;
  for (int i = 0; i < n; i++) temp.push_back(B[i]);
  sort(temp.begin(), temp.end());
  for (int i = 0; i < n; i++) {
    if (temp[i] != i + 1) {
      cout << -1 << "\n";
      return 0;
    }
  }
  for (int i = 0; i < n; i++) cout << B[i] << " ";
  cout << "\n";
}
