func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAXN = 2e5 + 10;   const int MOD = 1e9 + 7;   int n;   long long int a[MAXN], minn;   bool have[MAXN], flag;   int main() {     while (scanf( %d , &n) != EOF) {       a[1] = 0;       minn = 0;       memset(have, false, sizeof(have));       flag = true;       for (int i = 1; i < n; ++i) {         int num;         scanf( %I64d , &num);         a[i + 1] = a[i] + num;         minn = min(minn, a[i + 1]);       }       for (int i = 1; i <= n; ++i) {         a[i] += -minn + 1;         if (a[i] > n || have[a[i]]) {           printf( -1 n );           flag = false;           break;         }         have[a[i]] = true;       }       if (flag) {         for (int i = 1; i <= n; ++i) {           i == n ? printf( %I64d n , a[i]) : printf( %I64d  , a[i]);         }       }     }     return 0;   }   