func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MaxN = 1005;   char a[MaxN];   int b[MaxN];   bool prime(int x) {     for (int i = 2; i < x / 2; i++) {       if (x % 2 == 0) {         return false;       }     }     return true;   }   int main() {     string s;     int i, n, Max, j;     char v;     Max = 0;     for (i = 0; i < MaxN; i++) {       a[i] =    ;       b[i] = 0;     }     cin >> s;     for (i = 0; i < s.length(); i++) {       b[s[i]]++;       if (b[s[i]] > Max) {         Max = b[s[i]];         v = s[i];       }     }     for (i = 2; i <= s.length(); i++) {       if (prime(i)) {         if (i == 2) {           int ind = 1;           while (ind * i <= s.length()) {             if (a[ind * i] ==    ) {               a[ind * i] = (char)v;               b[v]--;               if (b[v] < 0) {                 cout <<  NO  << endl;                 return 0;               }             }             ind++;           }         } else {           if (i * 2 <= s.length()) {             int ind = 1;             while (ind * i <= s.length()) {               if (a[ind * i] ==    ) {                 a[ind * i] = (char)v;                 b[v]--;                 if (b[v] < 0) {                   cout <<  NO  << endl;                   return 0;                 }               }               ind++;             }           }         }       }     }     cout <<  YES  << endl;     for (i = 1; i <= s.length(); i++) {       if (a[i] ==    ) {         for (j = 0; j < MaxN; j++) {           if (b[j]) {             a[i] = (char)j;             b[j]--;             break;           }         }       }       cout << a[i];     }     cin.get();     cin.get();   }   