#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, a[N], ans[N];
bool vis[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n - 1; ++i) cin >> a[i];
  ans[0] = 1;
  for (int i = 1; i < n; ++i) ans[i] = ans[i - 1] + a[i - 1];
  int x = n - *max_element(ans, ans + n);
  for (int i = 0; i < n; ++i) {
    ans[i] += x;
    if (ans[i] < 1 || vis[ans[i]]++) return cout << "-1\n", 0;
  }
  for (int i = 0; i < n; ++i) cout << ans[i] << " \n"[i == n - 1];
  return 0;
}
