#include <bits/stdc++.h>
using namespace std;
const int M = 2 * 1e5 + 5;
int q[M], p[M];
int main() {
  int n;
  cin >> n;
  set<int> s;
  for (int i = 1; i < n; i++) {
    cin >> q[i];
  }
  p[1] = 0;
  s.insert(0);
  for (int i = 2; i < n + 1; i++) {
    p[i] = q[i - 1] + p[i - 1];
    s.insert(p[i]);
  }
  set<int>::iterator s0 = s.begin();
  set<int>::iterator s1 = s.begin();
  for (int i = 0; i < n - 1; i++) s1++;
  if (s.size() == n && *s0 <= 0) {
    bool x = 0;
    int i;
    for (i = 1; i <= n; i++) {
      if (*s0 + i == 1) {
        if (*s1 + i == n) {
          x = 1;
          break;
        }
      }
    }
    if (x) {
      for (int j = 1; j <= n; j++) {
        cout << p[j] + i << " ";
      }
    } else
      cout << "-1";
  } else
    cout << "-1";
}
