func_code_string: #include <bits/stdc++.h>   using namespace std;   const int inf = 0x3f3f3f3f;   char s[1010];   int a[1010], num[1010], b[30];   int prime[1010], notprime[1010];   priority_queue<pair<int, char> > pq;   set<pair<int, int> > st;   pair<int, int> c[1010];   int ans[1010];   int cnt;   void init() {     for (int i = 2; i <= 1000; i++) {       if (!notprime[i]) prime[cnt++] = i;       for (int j = 0; j < cnt && i * prime[j] <= 1000; j++) {         notprime[i * prime[j]] = 1;         if (i % prime[j] == 0) break;       }     }     for (int i = 0; i <= 1000; i++) a[i] = i, num[i] = 1;   }   int get(int x) { return a[x] == x ? x : a[x] = get(a[x]); }   void merge(int x, int y) {     int t1 = get(x);     int t2 = get(y);     if (t1 != t2) {       a[max(t1, t2)] = min(t1, t2);       num[min(t1, t2)] += num[max(t1, t2)];     }   }   bool cmp(pair<int, int> x, pair<int, int> y) { return x.first > y.first; }   int main() {     init();     scanf( %s , s);     int l = strlen(s);     for (int i = 0; i < l; i++) b[s[i] -  a ]++;     for (int i = 0; i < 30; i++)       if (b[i]) pq.push({b[i], i +  a });     for (int i = 0; i < cnt && prime[i] <= l; i++)       for (int j = 2; j <= l / prime[i]; j++) merge(prime[i], j * prime[i]);     st.insert({1, 1});     for (int i = 0; i < cnt && prime[i] <= l; i++) {       int r = get(prime[i]);       st.insert({num[r], r});     }     int num = 0, j = 0;     for (auto i : st) c[num++] = i;     sort(c, c + num, cmp);     int flag = 0;     while (pq.size() && j < num) {       pair<int, char> t = pq.top();       pq.pop();       if (t.first >= c[j].first)         ans[c[j].second] = t.second -  a ;       else {         flag = 1;         break;       }       if (t.first - c[j].first > 0) pq.push({t.first - c[j].first, t.second});       j++;     }     if (flag)       printf( NO n );     else {       printf( YES n );       for (int i = 1; i <= l; i++) printf( %c , ans[get(i)] +  a );     }     return 0;   }   