func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int n, o, z, t;     o = z = t = 0;     cin >> n;     string s;     cin >> s;     for (int i = 0; i < n; i++) {       if (s[i] ==  0 )         z++;       else if (s[i] ==  1 )         o++;       else         t++;     }     for (int i = 0; i < n && z < n / 3; i++) {       if (s[i] ==  1  && o > n / 3) {         s[i] =  0 ;         z++;         o--;       } else if (s[i] ==  2  && t > n / 3) {         s[i] =  0 ;         z++;         t--;       }     }     for (int i = 0; i < n && o < n / 3; i++) {       if (s[i] ==  2  && t > n / 3) {         s[i] =  1 ;         o++;         t--;       }     }     for (int i = n - 1; i >= 0 && t < n / 3; i--) {       if (s[i] ==  0  && z > n / 3) {         s[i] =  2 ;         t++;         z--;       } else if (s[i] ==  1  && o > n / 3) {         s[i] =  2 ;         t++;         o--;       }     }     for (int i = n - 1; i >= 0 && o < n / 3; i--) {       if (s[i] ==  0  && z > n / 3) {         s[i] =  1 ;         o++;         z--;       }     }     cout << s;     return 0;   }   