#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
ll n;
cin >> n;
vector<ll> d(n - 1);
for (auto &i : d) {
cin >> i;
}
vector<ll> a(n);
if (n == 2) {
if (d[0] == 0)
cout << -1 << "\n";
else if (d[0] == 1)
cout << "1 2" << "\n";
else if (d[0] == -1)
cout << "2 1" << "\n";
return 0;
}
ll check = 0;
for (int i = 1; i <= n; i++) {
a[0] = i;
for (int j = 1; j < n and check == 0; j++) {
a[j] = a[j - 1] + d[j - 1];
if (a[j] >= 1 and a[j] <= n)
continue;
else
check = 1;
}
if (check != 1) {
for (auto i : a) {
cout << i << " ";
}
return 0;
}
}
cout << -1 << "\n";
return 0;
}