#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
long long q[N];
long long p[N];
long long s[N];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> q[i];
  }
  for (int i = 1; i < n; i++) {
    s[i] = q[i - 1] + s[i - 1];
  }
  long long mini, maxi, min = 999999, max = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] > max) max = s[i];
    if (s[i] < min) min = s[i];
  }
  if (max - min + 1 > n) {
    cout << -1 << endl;
    return 0;
  }
  long long ans[N];
  for (int i = 0; i < n; i++) {
    ans[i] = s[i];
  }
  sort(s, s + n);
  for (int i = 1; i < n; i++) {
    if (s[i] == s[i - 1]) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] - (min - 1) << " ";
  }
  return 0;
}
