#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e5 + 5;
const int MOD = 1e9 + 7;
int d[maxn];
int a[maxn];
map<int, int> fl;
int main() {
  int n = 0;
  while (~scanf("%d", &n)) {
    for (int i = 1; i < n; i++) {
      scanf("%d", d + i);
    }
    int left = 1;
    int right = n;
    int mid;
    bool f = 0;
    while (right >= left) {
      mid = (left + right) / 2;
      a[1] = mid;
      fl.clear();
      fl[a[1]] = 1;
      int tmp = 0;
      int flag = 0;
      for (int i = 1; i < n; i++) {
        a[i + 1] = a[i] + d[i];
        if (a[i + 1] > n || a[i + 1] < 1) {
          tmp = i + 1;
          flag = 1;
          break;
        }
        if (fl[a[i + 1]] != 0) {
          flag = 1;
          f = 1;
          break;
        }
        fl[a[i + 1]] = 1;
      }
      if (flag == 0) {
        break;
      }
      if (a[tmp] < 1) {
        left = mid + 1;
      } else if (a[tmp] > n) {
        right = mid - 1;
      }
    }
    for (int i = 1; i <= n; i++) {
      if (a[i] > n || a[i] < 1) {
        f = 1;
        break;
      }
    }
    if (f == 1) {
      puts("-1");
      continue;
    }
    for (int i = 1; i <= n; i++) {
      printf("%d%c", a[i], i == n ? '\n' : ' ');
    }
  }
  return 0;
}
