#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int q[200005], a[200005];
bool vis[200005];
int main() {
  scanf("%d", &n);
  int t = 0;
  for (int i = 1; i < n; i++) {
    scanf("%d", &q[i]);
    q[i] += q[i - 1];
    if (q[i] < q[t]) t = i;
  }
  int d = 1 - q[t];
  for (int i = 0; i < n; i++) {
    a[i] = q[i] + d;
    if (a[i] >= 1 && a[i] <= n) vis[a[i]] = 1;
  }
  bool flag = 1;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) flag = 0;
  if (flag) {
    for (int i = 0; i < n; i++) printf("%d ", a[i]);
  } else {
    puts("-1");
  }
  return 0;
}
