#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long add(long long a, long long b) {
  a %= 1000000007;
  b %= 1000000007;
  return (a + b) % 1000000007;
}
long long sub(long long a, long long b) {
  a %= 1000000007;
  b %= 1000000007;
  return (a - b + 1000000007) % 1000000007;
}
long long prod(long long a, long long b) {
  a %= 1000000007;
  b %= 1000000007;
  return (a * b) % 1000000007;
}
long long a[1000005];
unordered_map<long long, long long> mark;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long sm = 0, last = 0;
  for (int i = 2; i <= n; i++) {
    long long x;
    cin >> x;
    a[i] = x;
    sm += last + x;
    last += x;
  }
  long long val = (n * (n + 1)) / 2;
  val -= sm;
  if (val % n || val <= 0) {
    cout << "-1";
    return 0;
  }
  val /= n;
  int i = 2;
  a[1] = val;
  mark[a[1]]++;
  if (a[1] > n) {
    cout << "-1";
    return 0;
  }
  while (i <= n) {
    a[i] += val;
    val = a[i];
    if (a[i] > n || a[i] <= 0 || mark[a[i]]) {
      cout << "-1";
      return 0;
    }
    mark[a[i]]++;
    i++;
  }
  for (i = 1; i <= n; i++) cout << a[i] << " ";
  return 0;
}
