#include <bits/stdc++.h>
using namespace std;
double pi = 2 * acos(0.0);
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << '{';
  for (const auto &x : v) os << " " << x;
  return os << '}';
}
void solve() {
  int n, in;
  cin >> n;
  long long int neg = 0, pve = 0;
  bool ok = true;
  int ix;
  bool p = false;
  vector<int> v, ans;
  int p1;
  for (int i = 1; i < n; i++) {
    cin >> in;
    v.push_back(in);
    neg += in;
    pve += in;
    if (neg == 0 || pve == 0 || pve >= n || neg <= (-n)) ok = false;
    if (pve == (n - 1)) {
      ix = i - 1;
      p = true;
      p1 = n;
    }
    if (neg == -(n - 1)) {
      ix = i - 1;
      p = true;
      p1 = 1;
    }
    if (pve < 0) {
      pve = 0;
    }
    if (neg > 0) {
      neg = 0;
    }
  }
  if (!ok || !p) {
    cout << "-1" << endl;
    return;
  }
  while (ix >= 0) {
    p1 -= v[ix];
    ix--;
  }
  cout << p1 << " ";
  for (int i = 0; i < n - 1; i++) {
    p1 += v[i];
    cout << p1 << " ";
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int test_cases = 1;
  for (int tc = 1; tc <= test_cases; tc++) {
    solve();
  }
  return 0;
}
