func_code_string: #include <bits/stdc++.h>   using namespace std;   priority_queue<pair<int, char> > pr;   bool is_prime(int n) {     if (n == 1) return 0;     for (int i = 2; i * i <= n; i++)       if (n % i == 0) return 0;     return 1;   }   vector<int> prime, pos[1004];   map<int, int> mark, mark2;   map<int, int>::iterator it;   bool vis[10000];   void solve(int n, int prm, int idx) {     vis[prm] = 1;     int rng = n / prm;     for (int j = 1; j <= rng; j++) {       int x = prm * j;       if (!mark2[x]) pos[idx].push_back(x);       mark2[x] = 1;       for (int k = 2; k * k <= x; k++) {         if (x % k == 0) {           while (x % k == 0) x /= k;           if (!vis[k] && k <= n) solve(n, k, idx);         }       }       if (x > 1 && !vis[x]) solve(n, x, idx);     }   }   int main() {     int n;     string tmp, str;     str +=  1 ;     cin >> tmp;     str += tmp;     n = tmp.size();     char ans[10000];     for (int i = 0; i <= n; i++) ans[i] =  1 ;     for (int i = 2; i <= n / 2; i++)       if (is_prime(i)) prime.push_back(i);     bool flg = 1;     int sz = 0;     for (int i = 0; i < prime.size(); i++)       if (!vis[prime[i]]) solve(n, prime[i], sz++);     for (int i = 1; i <= n; i++) mark[str[i]]++;     for (it = mark.begin(); it != mark.end(); it++)       pr.push(make_pair(it->second, it->first));     for (int i = 0; i < sz; i++) {       if (pos[i].size() <= pr.top().first) {         for (int j = 0; j < pos[i].size(); j++) ans[pos[i][j]] = pr.top().second;         int x = pr.top().first - pos[i].size();         char ch = pr.top().second;         pr.pop();         pr.push(make_pair(x, ch));       } else {         flg = 0;         break;       }     }     if (flg) {       printf( YES n );       for (int i = 1; i <= n; i++) {         if (ans[i] ==  1 ) {           while (!pr.top().first) pr.pop();           ans[i] = pr.top().second;           int x = pr.top().first - 1;           char ch = pr.top().second;           pr.pop();           pr.push(make_pair(x, ch));         }       }       for (int i = 1; i <= n; i++) printf( %c , ans[i]);       printf(  n );     } else       printf( NO n );   }   