#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int q[n - 1];
  for (int i = 0; i < n - 1; i++) {
    cin >> q[i];
  }
  long long int prefix = 0;
  long long int min_value = 0;
  for (int i = 0; i < n - 1; i++) {
    prefix = prefix + q[i];
    min_value = min(min_value, prefix);
  }
  long long int p[n];
  p[0] = 1 - min_value;
  if (p[0] <= 0 || p[0] > n) {
    cout << "-1\n";
    return 0;
  }
  for (int i = 0; i < n - 1; i++) {
    p[i + 1] = p[i] + q[i];
    if (p[i + 1] <= 0 || p[i + 1] > n) {
      cout << "-1\n";
      return 0;
    }
  }
  bool map[n + 1];
  for (int i = 0; i <= n; i++) {
    map[i] = false;
  }
  for (int i = 0; i < n; i++) {
    if (map[p[i]]) {
      cout << "-1\n";
      return 0;
    }
    map[p[i]] = true;
  }
  for (int i = 0; i < n; i++) {
    cout << p[i] << " ";
  }
  cout << "\n";
}
