#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 2e6;
int a[maxn];
int b[maxn];
int ans[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n - 1; i++) cin >> a[i];
  b[0] = ans[0] = 1;
  int tmp = 1;
  for (int i = 1; i <= n; i++) {
    b[i] = b[i - 1] + a[i];
    ans[i] = b[i];
    tmp = min(tmp, b[i]);
  }
  sort(b, b + n);
  int flag = 0;
  for (int i = 0; i < n - 1; i++) {
    if (b[i + 1] - b[i] != 1) {
      flag = 1;
      break;
    }
  }
  if (flag) {
    cout << -1 << endl;
  } else {
    if (tmp <= 0) {
      for (int i = 0; i < n; i++) {
        ans[i] = ans[i] - tmp + 1;
      }
      for (int i = 0; i < n; i++) {
        cout << ans[i] << ' ';
      }
      cout << endl;
    } else {
      for (int i = 0; i < n; i++) {
        cout << ans[i] << ' ';
      }
      cout << endl;
    }
  }
  return 0;
}
