#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int arr[N], ans[N];
set<int> ss;
int n;
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) cin >> arr[i];
  int m = 0;
  for (int i = 1; i < n; i++) {
    ans[i] = arr[i - 1] + ans[i - 1];
    m = min(m, ans[i]);
    ss.insert(ans[i]);
  }
  ss.insert(0);
  if (ss.size() != n) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) ans[i] += -m + 1;
  for (int i = 0; i < n; i++)
    if (!(1 <= ans[i] && ans[i] <= n)) {
      cout << -1 << endl;
      return 0;
    }
  for (int i = 0; i < n; i++) cout << ans[i] << " \n"[i == n - 1];
}
