#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int sum = 0;
  int arr[n - 1];
  int res[n];
  int x = 0;
  int flag = 0;
  int min_n = 0;
  set<int> s;
  for (int i = 0; i < n - 1; i++) {
    res[i] = sum;
    cin >> arr[i];
    sum += arr[i];
    min_n = min(sum, min_n);
  }
  res[n - 1] = sum;
  x = 1 - min_n;
  for (int i = 0; i < n; i++) {
    res[i] += x;
    s.insert(res[i]);
    if (res[i] <= 0 || res[i] > n) flag = 1;
  }
  if (s.size() != n) flag = 1;
  if (flag)
    cout << -1;
  else
    for (int i = 0; i < n; i++) cout << res[i] << " ";
}
