#include <bits/stdc++.h>
using namespace std;
void printarr(long long int* arr, int len, long long int diff) {
  for (int i = 0; i < len; i++) {
    cout << arr[i] + diff << " ";
  }
  cout << "\n";
}
bool check(long long int* arr, int len) {
  sort(arr, arr + len);
  for (int i = 1; i < len; i++) {
    if (arr[i] - arr[i - 1] != 1) {
      return false;
    }
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  long long int a, sumarr[n];
  sumarr[0] = 0;
  long long int min = 0;
  for (int i = 0; i < n - 1; i++) {
    cin >> a;
    sumarr[i + 1] = sumarr[i] + a;
    if (sumarr[i + 1] < min) min = sumarr[i + 1];
  }
  long long int diff = 1 - min, arr[n];
  for (int i = 0; i < n; i++) {
    arr[i] = sumarr[i] + diff;
  }
  if (check(arr, n)) {
    printarr(sumarr, n, diff);
  } else {
    cout << -1 << "\n";
  }
}
