func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int n, ans = 0, ans1 = 0, ans2 = 0, tar;     cin >> n;     tar = n / 3;     string s;     cin >> s;     for (int i = 0; i < n; i++) {       int val = s[i] -  0 ;       if (val == 0)         ans++;       else if (val == 1)         ans1++;       else         ans2++;     }     for (int i = 0; tar > ans; i++) {       if (i == n) break;       if (s[i] ==  1  and tar < ans1) {         s[i] =  0 ;         ans++;         ans1--;         continue;       }       if (s[i] ==  2  and tar < ans2) {         s[i] =  0 ;         ans++;         ans2--;         continue;       }     }     for (int i = n - 1; (tar < ans1) and ans2 < tar; i--) {       if (i < 0) break;       if (s[i] ==  1 ) {         s[i] =  2 ;         ans2++;         ans1--;       }     }     for (int i = n - 1; (tar < ans) and ans2 < tar; i--) {       if (i < 0) break;       if (s[i] ==  0 ) {         s[i] =  2 ;         ans2++;         ans--;       }     }     for (int i = 0; (tar < ans2) and ans1 < tar; i++) {       if (i == n) break;       if (s[i] ==  2 ) {         s[i] =  1 ;         ans1++;         ans2--;       }     }     for (int i = n - 1; (tar < ans) and ans1 < tar; i--) {       if (i < 0) break;       if (s[i] ==  0 ) {         s[i] =  1 ;         ans1++;         ans--;       }     }     cout << s << endl;   }   