func_code_string: #include <bits/stdc++.h>   const double pi = acos(-1.0);   const int INF = 0x3f3f3f3f;   const double eps = 1e-8;   const int MAXN = 1e3 + 10;   const int mod = 1e9 + 7;   const int dir[][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};   const int seed = 131;   int cases = 0;   char str[MAXN];   int mp[MAXN], col[MAXN], cnt[30], vis[MAXN], need[MAXN], ans[MAXN];   std::vector<int> primes, fac[MAXN], f[MAXN];   std::priority_queue<std::pair<int, int> > num;   std::vector<std::pair<int, int> > number_of_need;   void init() {     for (int i = 2; i < MAXN; i++)       if (!vis[i])         for (int j = i; j < MAXN; j += i) {           fac[j].push_back(i);           if (j != i) vis[j] = 1;         }     for (int i = 2; i < MAXN; i++)       if (!vis[i]) primes.push_back(i);   }   int find(int n) { return col[n] = n == col[n] ? n : find(col[n]); }   int main() {     init();     scanf( %s , str);     int len = strlen(str);     for (int i = 0; i < len; i++) cnt[str[i] -  a ]++;     for (int i = 0; i < 26; i++)       if (cnt[i]) num.push({cnt[i], i});     for (int i = 2; i <= len; i++) {       if ((int)fac[i].size() == 1)         col[i] = i;       else {         int v = find(fac[i][0]);         for (int j = 1; j < (int)fac[i].size(); j++) col[fac[i][j]] = v;       }     }     for (int pri : primes) {       if (pri > len) break;       find(pri);     }     for (int i = 2; i <= len; i++) f[col[fac[i][0]]].push_back(i);     for (int i = 2; i <= len; i++)       if (!f[i].empty()) {         if (num.empty() || num.top().first < (int)f[i].size()) {           puts( NO );           return 0;         }         std::pair<int, int> u = num.top();         num.pop();         for (int j : f[i]) str[j] = char(u.second +  a );         if (u.first - (int)f[i].size() > 0)           num.push({u.first - (int)f[i].size(), u.second});       }     if (num.empty()) {       puts( NO );       return 0;     }     str[1] = char(num.top().second +  a );     puts( YES );     printf( %s n , str + 1);     return 0;   }   