#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  int q[n - 1];
  for (int i = 0; i < n - 1; i++) {
    cin >> q[i];
  }
  int p[n];
  p[0] = 0;
  int val = 0;
  for (int i = 1; i < n; i++) {
    p[i] = q[i - 1] + p[i - 1];
    val = min(val, p[i]);
  }
  unordered_set<int> s;
  for (int i = 1; i <= n; i++) {
    s.insert(i);
  }
  bool res = true;
  for (int i = 0; i < n; i++) {
    p[i] += -1 * val + 1;
    if (s.find(p[i]) == s.end()) {
      res = false;
      break;
    } else {
      s.erase(p[i]);
    }
  }
  if (res) {
    for (int i = 0; i < n; i++) cout << p[i] << " ";
  } else {
    cout << -1;
  }
  return 0;
}
