#include <bits/stdc++.h>
using namespace std;
int p[200005] = {0}, q[200005] = {0}, maxi = 0;
int main() {
  map<int, int> flag;
  int i, n, x = 0, ans = 0;
  cin >> n;
  for (i = 0; i < n - 1; i++) {
    cin >> q[i];
    x += q[i];
    maxi = min(x, maxi);
  }
  x = (1 - maxi);
  bool ok = true;
  p[0] = x;
  flag[x] = 1;
  if (p[0] < 1 || p[0] > n) ok = false;
  for (i = 0; i < n - 1; i++) {
    x += q[i];
    p[i + 1] = x;
    if (p[i + 1] < 1 || p[i + 1] > n || flag[p[i + 1]]) ok = false;
    flag[p[i + 1]] = 1;
  }
  if (!ok)
    cout << -1;
  else {
    for (i = 0; i < n; i++) cout << p[i] << " ";
  }
  return 0;
}
