#include <bits/stdc++.h>
using namespace std;
bool gr(long i1, long i2) { return i1 > i2; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long n;
  cin >> n;
  long q[n - 1];
  for (long i = 0; i <= n - 1 - 1; ++i) cin >> q[i];
  long a[n];
  a[0] = 0;
  long min_val = 0;
  for (long i = 0; i <= n - 1 - 1; ++i) {
    a[i + 1] = a[i] + q[i];
    if (a[i + 1] < min_val) {
      min_val = a[i + 1];
    }
  }
  long b[n];
  for (long i = 0; i <= n - 1; ++i) {
    b[i] = a[i];
  }
  sort(b, b + n);
  for (long i = 0; i <= n - 1 - 1; ++i) {
    if (b[i] == b[i + 1]) {
      cout << "-1";
      return 0;
    }
  }
  if (b[n - 1] != b[0] + n - 1) {
    cout << "-1";
    return 0;
  }
  for (long i = 0; i <= n - 1; ++i) {
    cout << a[i] - min_val + 1 << " ";
  }
  return 0;
}
