#include <bits/stdc++.h>
using namespace std;
long long a[200005], sum[200005], vis[200005];
long long t = 0, minn = 0, flag;
int main() {
  long long n, x;
  ios::sync_with_stdio(false);
  cin >> n;
  int flag = 0;
  for (int i = 1; i <= n - 1; i++) {
    cin >> x;
    sum[i] = sum[i - 1] + x;
    a[i] = sum[i];
    if (a[i] == 0 || a[i] >= n || a[i] <= -n) {
      flag = 1;
    }
    minn = min(minn, sum[i]);
  }
  if (minn <= 0) {
    for (int i = 1; i <= n - 1; i++) {
      a[i] -= minn;
    }
  }
  for (int i = 1; i <= n - 1; i++) {
    if (a[i] >= n || vis[a[i]]) {
      flag = 1;
    } else {
      vis[a[i]] = 1;
    }
  }
  if (flag) {
    cout << "-1\n";
  } else {
    t = 0;
    for (int i = 1; i <= n - 1; i++) {
      if (!vis[i]) {
        t = i;
      }
    }
    t++;
    for (int i = 1; i <= n; i++) {
      if (i == 1) {
        cout << t << " ";
      } else {
        cout << t + sum[i - 1] << " ";
      }
    }
    cout << endl;
  }
  return 0;
}
