#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
int a[N];
int b[N];
int main() {
  int n;
  cin >> n;
  a[1] = 0;
  for (int i = 2; i <= n; ++i) {
    int k;
    cin >> k;
    a[i] = a[i - 1] + k;
  }
  int x = 1e6;
  for (int j = 1; j <= n; ++j) {
    x = min(x, a[j]);
  }
  for (int i = 1; i <= n; ++i) {
    if (a[i] - x + 1 >= 1 && a[i] - x + 1 <= n) {
      b[a[i] - x + 1] = 1;
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (b[i] == 0) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 1; i <= n; ++i) {
    cout << a[i] - x + 1 << " ";
  }
  cout << endl;
  return 0;
}
