#include <bits/stdc++.h>
using namespace std;
long long n, q[202020], t[202020], s[202020];
void fail() {
  cout << -1;
  exit(0);
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i < n; i++) cin >> q[i];
  for (int i = 1; i < n; i++) {
    s[i] = s[i - 1] + q[i];
  }
  copy_n(s, n, t);
  sort(s, s + n);
  for (int i = 1; i < n; i++) {
    if (s[i] != 1 + s[i - 1]) fail();
  }
  for (int i = 0; i < n; i++) cout << ' ' << (1 - s[0]) + t[i];
}
