#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ar[n];
  ar[0] = 0;
  for (int j = 0; j < n - 1; j++) {
    int g;
    cin >> g;
    ar[j + 1] = ar[j] + g;
  }
  int x = *min_element(ar, ar + n);
  map<int, int> mp, pm;
  for (int i = 0; i < n; i++) {
    mp[ar[i] - x + 1]++;
  }
  for (int i = 0; i < n; i++) pm[i + 1]++;
  if (mp != pm) {
    cout << -1;
    return 0;
  }
  for (int i = 0; i < n; i++) cout << ar[i] - x + 1 << " ";
}
