#include <bits/stdc++.h>
using namespace std;
int n, mi = 20000000, a[2000100], x;
map<int, int> num;
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) scanf("%d", &x), a[i] = a[i - 1] + x;
  for (int i = 1; i <= n; i++) mi = min(mi, a[i]);
  for (int i = 1; i <= n; i++) a[i] -= (mi - 1);
  for (int i = 1; i <= n; i++) num[a[i]]++;
  for (int i = 1; i <= n; i++)
    if (num[i] > 1 || num[i] == 0) return puts("-1"), 0;
  for (int i = 1; i <= n; i++) printf("%d ", a[i]);
  return 0;
}
