func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long nax = 1e5 + 7;   const long long mod = 1e9 + 7;   const long long inf = numeric_limits<long long>::max();   long long n, m;   bool check(vector<long long> &vec) {     vector<long long> freq(n + 1, 0);     for (long long i = 0; i < n; i++) {       if (vec[i] > n) return false;       freq[vec[i]]++;       if (freq[vec[i]] > 1) {         return false;       }     }     for (long long i = 0; i < n; i++) {       if (freq[i + 1] != 1) return false;     }     return true;   }   void test() {     cin >> n;     vector<long long> vec;     vec.push_back(0);     long long first = 0;     for (long long i = 1; i < n; i++) {       long long t;       cin >> t;       vec.push_back(vec.back() + t);       first = min(first, vec.back());     }     first = 1 - first;     for (long long &x : vec) x += first;     if (check(vec))       for (long long x : vec) cout << x <<    ;     else       cout << -1;   }   signed main() {     ios_base ::sync_with_stdio(false);     cin.tie(NULL);     long long T = 1;     while (T--) {       test();       cout <<   n ;     }     return 0;   }   