#include <bits/stdc++.h>
int n, a[200010], minv, bucket[200010], mark;
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i)
    scanf("%d", a + i), a[i] += a[i - 1], minv = a[i] < minv ? a[i] : minv;
  for (int i = 1; i <= n; ++i)
    if (a[i] + 1 > n + minv || a[i] < minv || bucket[a[i] - minv + 1]) {
      mark = 1;
      break;
    } else
      ++bucket[a[i] - minv + 1];
  if (mark)
    puts("-1");
  else
    for (int i = 1; i <= n; ++i) printf("%d ", a[i] - minv + 1);
  return 0;
}
