#include <bits/stdc++.h>
using namespace std;
long long a, b[200005], s[200005];
int main() {
  long long n, min = 0;
  cin >> n;
  b[0] = 0;
  memset(s, 0, sizeof(s));
  for (int i = 1; i <= n - 1; i++) {
    cin >> a;
    b[i] = b[i - 1] + a;
    if (b[i] < min) min = b[i];
  }
  int flag = 1;
  for (int i = 0; i < n; i++) {
    b[i] = b[i] - min + 1;
    if (b[i] > n) {
      flag = 0;
      break;
    }
    s[b[i]]++;
  }
  if (flag) {
    for (int i = 1; i <= n; i++) {
      if (s[i] == 0) {
        flag = 0;
        break;
      }
    }
  }
  if (flag == 0)
    cout << -1 << endl;
  else {
    for (int i = 0; i < n; i++) {
      cout << b[i];
      if (i != n - 1) cout << ' ';
    }
    cout << endl;
  }
  return 0;
}
