#include <bits/stdc++.h>
using namespace std;
int a[200005] = {0};
int b[200005];
int c[200005];
bool vis[200005];
int main() {
  int e, n;
  bool flag = true;
  memset(vis, false, sizeof(vis));
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    cin >> b[i];
    a[i] = a[i - 1] + b[i];
  }
  sort(a + 1, a + n);
  if (a[n - 1] < 0)
    c[1] = n;
  else
    c[1] = n - a[n - 1];
  if (c[1] <= 0 || c[1] > n) {
    cout << -1 << endl;
    return 0;
  }
  vis[c[1]] = true;
  for (int i = 2; i <= n; i++) {
    c[i] = c[i - 1] + b[i - 1];
    if (c[i] <= 0 || c[i] > n) {
      cout << -1 << endl;
      return 0;
    } else if (vis[c[i]]) {
      cout << -1 << endl;
      return 0;
    }
    vis[c[i]] = true;
  }
  for (int i = 1; i <= n; i++) cout << c[i] << ' ';
  cout << endl;
  return 0;
}
