#include <bits/stdc++.h>
using namespace std;
const int Max = 200005;
int n, a[Max], b[Max], c[Max], add;
int main() {
  cin >> n;
  for (int i = 1; i < n; ++i) {
    cin >> a[i];
    c[i] = b[i] = a[i] + b[i - 1];
  }
  sort(c, c + n);
  add = 1 - c[0];
  for (int i = 0; i < n; ++i) {
    if (c[i] + add != i + 1) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 0; i < n; ++i) cout << b[i] + add << " ";
  return 0;
}
