#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long p[n];
  long long q[n - 1];
  long long sum = 0;
  long long minsum = 0;
  for (int i = 0; i < n - 1; i++) {
    cin >> q[i];
    sum = sum + q[i];
    if (sum < minsum) {
      minsum = sum;
    }
  }
  long long pp[n];
  p[0] = 1 - minsum;
  pp[0] = 1 - minsum;
  for (int i = 0; i < n; i++) {
    p[i + 1] = p[i] + q[i];
    pp[i + 1] = pp[i] + q[i];
  }
  bool check = true;
  for (int i = 0; i < n; i++) {
    if (p[i] < 1 || p[i] > n) {
      check = false;
      break;
    }
  }
  sort(pp, pp + n);
  for (int i = 0; i < n - 1; i++) {
    if (pp[i] == (pp[i + 1] - 1)) {
      check = true;
    } else {
      check = false;
      break;
    }
  }
  if (check) {
    for (int i = 0; i < n; i++) {
      cout << p[i] << " ";
    }
  } else {
    cout << -1;
  }
  return 0;
}
