func_code_string: #include <bits/stdc++.h>   using namespace std;   bool check(string s) {     int count = 0;     for (char el : s) {       if (el ==  ( ) {         count++;       } else {         count--;       }       if (count < 0) return false;     }     return true;   }   void solve() {     int n;     cin >> n;     string s;     cin >> s;     if (s[0] ==  )  || s[s.size() - 1] ==  (  || s.size() % 2) {       cout <<  :(  << endl;       return;     }     int in = 0, out = 0;     for (char el : s) {       in += (el ==  ( );       out += (el ==  ) );     }     if (in > n / 2 || out > n / 2) {       cout <<  :(  << endl;       return;     }     int first = (n / 2) - in;     int second = (n / 2) - out;     int count = 0;     for (int i = 0; i < n; i++) {       if (s[i] ==  ? ) {         if (first > 0) {           s[i] =  ( ;           first--;           count++;         } else {           s[i] =  ) ;           second--;           count--;         }       } else if (s[i] ==  ( ) {         count++;       } else {         count--;       }       if (count == 0 && i != n - 1) {         cout <<  :(  << endl;         return;       } else if (count < 0) {         cout <<  :(  << endl;         return;       }     }     cout << (check(s) ? s :  :( ) << endl;   }   int main() { solve(); }   