#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
#define twodp vector<vector<ll> >dp(n+1,vec (k+1,0));
using namespace std;
ll dp[203][203][203];
ll tem(vec v1,vec v2,vec v3,ll i,ll j,ll k,ll n)
{
    ll p,q,r;
    if(dp[i][j][k]!=-1)
    return dp[i][j][k];
    if((i<n) && (j<n))
        p=v1[i]*v2[j]+tem(v1,v2,v3,i+1,j+1,k,n);
    if((j<n) && (k<n))
        q=v2[j]*v3[k]+tem(v1,v2,v3,i,j+1,k+1,n);
    if((i<n) && (k<n))
        r=v1[i]*v3[k]+tem(v1,v2,v3,i+1,j,1+k,n);
    return (dp[i][j][k]=max(max(p,q),r));
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll n=max(max(r,g),b);
    n++;
    ll i,j,k,l;
    vec v1;
    vec v2;
    vec v3;
    for(i=0;i<r;i++)
    {
       cin>>j;
       v1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        v2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        v3.pb(j);
    }
    for(i=v1.size();i<n;i++)
        v1.pb(0);

    for(i=v2.size();i<n;i++)
        v2.pb(0);

    for(i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {
            for(k=0;k<n;k++)
                dp[i][j][k]=-1;
        }
    }
    for(i=v3.size();i<n;i++)
        v3.pb(0);

    sort(v1.rbegin(),v1.rend());
    sort(v2.rbegin(),v2.rend());
    sort(v3.rbegin(),v3.rend());

    k=tem(v1,v2,v3,0,0,0,n);
    cout<<k;

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
using namespace std;
vector<vector<vector<ll> > >v0;
ll bul(ll i,ll j,ll k,ll n1,ll n2,ll n3,vec v1,vec v2,vec v3)
{
    ll c1=0;
    if(i>=n1)
        {
            c1++;
            i=n1;
        }
      if(j>=n2)
        {
            c1++;
            j=n2;
        }
        if(k>=n3)
        {
            c1++;
            k=n3;
        }
        if(c1>=2)
            return 0;
    if(v0[i][j][k]>0)
        return v0[i][j][k];
    ll a,b,c;
    a=-1;
    b=-1;
    c=-1;
    if(i<n1)
    {
       a=v1[i];
    }
    if(j<n2)
    {
       b=v2[j];
    }
    if(k<n3)
    {
       c=v3[k];
    }
    if(a*b*c<0)
        {
           if(c==-1)
            return v0[i][j][k]=(a*b+bul(i+1,j+1,k,n1,n2,n3,v1,v2,v3) );
           if(a==-1)
            return v0[i][j][k]=(c*b+bul(i,j+1,k+1,n1,n2,n3,v1,v2,v3) );
            if(b==-1)
            return v0[i][j][k]=(a*c+bul(i+1,j,k+1,n1,n2,n3,v1,v2,v3) );
        }
    if((a==b)&&(b==c))
    {
        ll p,q,r;
        p=a*b+bul(i+1,j+1,k,n1,n2,n3,v1,v2,v3);
        q=a*b+bul(i,j+1,1+k,n1,n2,n3,v1,v2,v3);
        r=a*b+bul(i+1,j,1+k,n1,n2,n3,v1,v2,v3);
        ll s=max(max(p,q),r);
        if(s==p)
            return v0[i][j][k]=p;
        if(s==q)
            return v0[i][j][k]=q;
        return v0[i][j][k]=r;
    }
    ll p,q,r;
    p=a*b;
    q=c*b;
    r=a*c;
    ll s=max(max(p,q),r);
    if(s==p)
    {
        return v0[i][j][k]=p;
    }
    if(s==q)
            return v0[i][j][k]=q;
    return v0[i][j][k]=r;
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll i,j,k,l;
    vec q1;
    vec q2;
    vec q3;
    for(i=0;i<r;i++)
    {
        cin>>j;
        q1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        q2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        q3.pb(j);
    }
    for(i=0;i<r+10;i++)
    {
        vector<vector<ll> >tem;
        for(j=0;j<b+10;j++)
        {
            vec z(g+10,0);
            tem.pb(z);
        }
        v0.pb(tem);
    }
    sort(q1.rbegin(),q1.rend());
    sort(q2.rbegin(),q2.rend());
    sort(q3.rbegin(),q3.rend());
    k=bul(0,0,0,r,g,b,q1,q2,q3);
    cout<<k;

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
using namespace std;
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll i,j,k,l;
    priority_queue<ll> q1;
    priority_queue<ll> q2;
    priority_queue<ll> q3;
    for(i=0;i<r;i++)
    {
        cin>>j;
        q1.push(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        q2.push(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        q3.push(j);
    }
    ll c1=0;
    ll sum=0;
    while(c1<2)
    {
        c1=0;
        i=-1;
        j=-1;
        k=-1;
        if(q1.size()!=0)
        {
            i=q1.top();
        }
        if(q2.size()!=0)
        {
            j=q2.top();
        }
        if(q3.size()!=0)
        {
            k=q3.top();
        }
      vec v1;
      v1.pb(i);
      v1.pb(j);
      v1.pb(k);
    sort(v1.rbegin(),v1.rend());
      if(i==v1[0])
        {
            i=-1;
            q1.pop();
        }
      else if(j==v1[0])
         {
             j=-1;
             q2.pop();
         }
       else
        {
            k=-1;
            q3.pop();
        }
      if(i==v1[1])
        q1.pop();
      else if(j==v1[1])
         q2.pop();
       else
        q3.pop();

       if(q1.size()==0)
        c1++;
       if(q2.size()==0)
        c1++;
        if(q3.size()==0)
        c1++;
       sum=sum+v1[0]*v1[1];
    }
  cout<<sum<<"\n";

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
#define twodp vector<vector<ll> >dp(n+1,vec (k+1,0));
using namespace std;
ll dp[203][203][203];
ll tem(vec v1,vec v2,vec v3,ll i,ll j,ll k,ll n1,ll n2,ll n3)
{
    ll p,q,r;
    p=-1;
    q=-1;
    r=-1;
    if(dp[i][j][k]!=-1)
    return dp[i][j][k];
    if((i<n1) && (j<n2))
        p=v1[i]*v2[j]+tem(v1,v2,v3,i+1,j+1,k,n1,n2,n3);
    if((j<n2) && (k<n3))
        q=v2[j]*v3[k]+tem(v1,v2,v3,i,j+1,k+1,n1,n2,n3);
    if((i<n1) && (k<n3))
        r=v1[i]*v3[k]+tem(v1,v2,v3,i+1,j,1+k,n1,n2,n3);
    if(p+q+r==-3)
        return dp[i][j][k]=0;
    else
    return (dp[i][j][k]=max(max(p,q),r));
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll i,j,k,l;
    vec v1;
    vec v2;
    vec v3;
    for(i=0;i<r;i++)
    {
       cin>>j;
       v1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        v2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        v3.pb(j);
    }

    for(i=0;i<203;i++)
    {
        for(j=0;j<203;j++)
        {
            for(k=0;k<203;k++)
                dp[i][j][k]=-1;
        }
    }

    sort(v1.rbegin(),v1.rend());
    sort(v2.rbegin(),v2.rend());
    sort(v3.rbegin(),v3.rend());

    k=tem(v1,v2,v3,0,0,0,r,g,b);
    cout<<k;

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
#define twodp vector<vector<ll> >dp(n+1,vec (k+1,0));
using namespace std;
ll dp[202][202][202];
ll tem(vec v1,vec v2,vec v3,ll i,ll j,ll k,ll n)
{
    ll p,q,r;
    if(dp[i][j][k]!=-1)
    return dp[i][j][k];
    if((i<n) && (j<n))
        p=v1[i]*v2[j]+tem(v1,v2,v3,i+1,j+1,k,n);
    if((j<n) && (k<n))
        q=v2[j]*v3[k]+tem(v1,v2,v3,i,j+1,k+1,n);
    if((i<n) && (k<n))
        r=v1[i]*v3[k]+tem(v1,v2,v3,i+1,j,1+k,n);
    return (dp[i][j][k]=max(max(p,q),r));
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll n=max(max(r,g),b);
    ll i,j,k,l;
    vec v1;
    vec v2;
    vec v3;
    for(i=0;i<r;i++)
    {
       cin>>j;
       v1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        v2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        v3.pb(j);
    }
    for(i=v1.size();i<n;i++)
        v1.pb(0);

    for(i=v2.size();i<n;i++)
        v2.pb(0);

    for(i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {
            for(k=0;k<n;k++)
                dp[i][j][k]=-1;
        }
    }
    for(i=v3.size();i<n;i++)
        v3.pb(0);

    sort(v1.rbegin(),v1.rend());
    sort(v2.rbegin(),v2.rend());
    sort(v3.rbegin(),v3.rend());

    k=tem(v1,v2,v3,0,0,0,n);
    cout<<k;

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
#define twodp vector<vector<ll> >dp(n+1,vec (k+1,0));
using namespace std;
ll dp[203][203][203];
ll tem(vec v1,vec v2,vec v3,ll i,ll j,ll k,ll n)
{
    ll p,q,r;
    if(dp[i][j][k]!=-1)
    return dp[i][j][k];
    if((i<n) && (j<n))
        p=v1[i]*v2[j]+tem(v1,v2,v3,i+1,j+1,k,n);
    if((j<n) && (k<n))
        q=v2[j]*v3[k]+tem(v1,v2,v3,i,j+1,k+1,n);
    if((i<n) && (k<n))
        r=v1[i]*v3[k]+tem(v1,v2,v3,i+1,j,1+k,n);
    return (dp[i][j][k]=max(max(p,q),r));
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll n=max(max(r,g),b);
    n++;
    ll i,j,k,l;
    vec v1;
    vec v2;
    vec v3;
    for(i=0;i<r;i++)
    {
       cin>>j;
       v1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        v2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        v3.pb(j);
    }
    for(i=v1.size();i<n;i++)
        v1.pb(0);

    for(i=v2.size();i<n;i++)
        v2.pb(0);

    for(i=0;i<203;i++)
    {
        for(j=0;j<203;j++)
        {
            for(k=0;k<203;k++)
                dp[i][j][k]=-1;
        }
    }
    for(i=v3.size();i<n;i++)
        v3.pb(0);

    sort(v1.rbegin(),v1.rend());
    sort(v2.rbegin(),v2.rend());
    sort(v3.rbegin(),v3.rend());

    k=tem(v1,v2,v3,0,0,0,n);
    cout<<k;

}


#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define pb push_back
#define mp make_pair
#define Boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

void Print(vector <long> &A) {
    int n = A.size();
    for(int i=0;i<n;i++) cout << A[i] << " \n"[i==n-1];
}

void Crack() {
    long r,g,b;
    cin >> r >> g >> b;
    vector <long> R(r);
    vector <long> G(g);
    vector <long> B(b);
    for(int i=0;i<r;i++) cin >> R[i];
    for(int i=0;i<g;i++) cin >> G[i];
    for(int i=0;i<b;i++) cin >> B[i];
    sort(R.begin(),R.end(),greater<int>());
    sort(G.begin(),G.end(),greater<int>());
    sort(B.begin(),B.end(),greater<int>());
    long long ans = 0;
    long c = 0;
    while(1) {
        r = R.size();
        g = G.size();
        b = B.size();
        if(r==0) c = 1;
        if(g==0) c = 2;
        if(b==0) c = 3;
        if(c!=0) break;
        r = R[0];g = G[0];b = B[0];
        if(r<g && r<b) {
            ans += g*b;
            G.erase(G.begin());
            B.erase(B.begin());
        } else if(g<r && g<b) {
            ans += r*b;
            R.erase(R.begin());
            B.erase(B.begin());
        } else {
            ans += g*r;
            G.erase(G.begin());
            R.erase(R.begin());
        }
    }
    if(c==1) {
        while(G.size() && B.size()) {
            ans += G[0]*B[0];
            G.erase(G.begin());
            B.erase(B.begin());
        }
    } else if(c==2) {
        while(R.size() && B.size()) {
            ans += R[0]*B[0];
            R.erase(R.begin());
            B.erase(B.begin());
        }
    } else {
        while(G.size() && R.size()) {
            ans += G[0]*R[0];
            G.erase(G.begin());
            R.erase(R.begin());
        }
    }

    cout << ans << endl;
}

int main()
{
    Boost;
    Crack();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define Boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

void Print(vector <long> &A) {
    int n = A.size();
    for(int i=0;i<n;i++) cout << A[i] << " \n"[i==n-1];
}

bool sortbydec(const pair<int,int> &a,const pair<int,int> &b){
    return(a.first>b.first);
}

void Crack() {
    long r,g,b,a;
    cin >> r >> g >> b;
    vector <pair<int,int>> A(r+g+b);
    for(int i=0;i<r;i++) {
        cin >> a;
        A.pb(mp(a,1));
    }
    for(int i=r;i<r+g;i++){
        cin >> a;
        A.pb(mp(a,2));
    }
    for(int i=r+g;i<r+g+b;i++) {
        cin >> a;
        A.pb(mp(a,3));
    }
    sort(A.begin(),A.end(),sortbydec);
    int n = A.size();
    long long ans = 0;
    int i,j;
    i = 0;
    while(i<n) {
        a = A[i].s;
        if(a==-1) {
            i++;
            continue;
        }
        j = i+1;
        while(j<n && (a==A[j].s || A[j].s==-1)) j++;
        if(j==n) break;
        ans = ans + A[i].f*A[j].f;
        A[j].s = -1;
        A[i].s = -1;
        i++;
    }
    cout << ans << endl;
}

int main()
{
    Boost;
    Crack();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define pb push_back
#define mp make_pair
#define Boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

void Print(vector <long> &A) {
    int n = A.size();
    for(int i=0;i<n;i++) cout << A[i] << " \n"[i==n-1];
}

void Crack() {
    long r,g,b;
    cin >> r >> g >> b;
    vector <long> R(r);
    vector <long> G(g);
    vector <long> B(b);
    for(int i=0;i<r;i++) cin >> R[i];
    for(int i=0;i<g;i++) cin >> G[i];
    for(int i=0;i<b;i++) cin >> B[i];
    sort(R.begin(),R.end(),greater<int>());
    sort(G.begin(),G.end(),greater<int>());
    sort(B.begin(),B.end(),greater<int>());
    long long ans = 0;
    long c = 0;
    while(1) {
        r = R.size();
        g = G.size();
        b = B.size();
        if(r==0) c = 1;
        if(g==0) c = 2;
        if(b==0) c = 3;
        if(c!=0) break;
        r = R[0];g = G[0];b = B[0];
        if(r<=g && r<=b) {
            ans += g*b;
            G.erase(G.begin());
            B.erase(B.begin());
        } else if(g<=r && g<=b) {
            ans += r*b;
            R.erase(R.begin());
            B.erase(B.begin());
        } else {
            ans += g*r;
            G.erase(G.begin());
            R.erase(R.begin());
        }
    }
    if(c==1) {
        while(G.size() && B.size()) {
            ans += G[0]*B[0];
            G.erase(G.begin());
            B.erase(B.begin());
        }
    } else if(c==2) {
        while(R.size() && B.size()) {
            ans += R[0]*B[0];
            R.erase(R.begin());
            B.erase(B.begin());
        }
    } else {
        while(G.size() && R.size()) {
            ans += G[0]*R[0];
            G.erase(G.begin());
            R.erase(R.begin());
        }
    }

    cout << ans << endl;
}

int main()
{
    Boost;
    Crack();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define Boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

void Print(vector <long> &A) {
    int n = A.size();
    for(int i=0;i<n;i++) cout << A[i] << " \n"[i==n-1];
}

bool sortbydec(const pair<int,int> &a,const pair<int,int> &b){
    if(a.f==b.f) return(a.s>b.s);
    return(a.f>b.f);
}

void Crack() {
    int r,g,b,a;
    cin >> r >> g >> b;
    vector <pair<int,int>> A(r+g+b);
    int c = 0;
    if(r>g+b) c = 1;
    if(b>g+r) c = 2;
    if(g>r+b) c = 3;
    vector <pair<int,int>> B(r+g+b);
    for(int i=0;i<r;i++) {
        cin >> a;
        A.pb(mp(a,1));
        if(c==1) B.pb(mp(a,1));
        else if(c==2) B.pb(mp(a,2));
        else if(c==3) B.pb(mp(a,2));
    }
    for(int i=r;i<r+g;i++){
        cin >> a;
        A.pb(mp(a,2));
        if(c==1) B.pb(mp(a,2));
        else if(c==2) B.pb(mp(a,1));
        else if(c==3) B.pb(mp(a,2));
    }
    for(int i=r+g;i<r+g+b;i++) {
        cin >> a;
        A.pb(mp(a,3));
        if(c==1) B.pb(mp(a,2));
        else if(c==2) B.pb(mp(a,2));
        else if(c==3) B.pb(mp(a,1));
    }
    sort(A.begin(),A.end(),sortbydec);
    sort(B.begin(),B.end(),sortbydec);
    int n = r+g+b;
    long long ans = 0,ans1 = 0;
    int i,j;
    i = 0;
    while(i<n) {
        a = A[i].s;
        if(a==-1) {
            i++;
            continue;
        }
        j = i+1;
        while(j<n && (a==A[j].s || A[j].s==-1)) j++;
        if(j==n) break;
        ans = ans + A[i].f*A[j].f;
        A[j].s = -1;
        A[i].s = -1;
        i++;
    }
    i = 0;
    while(i<n) {
        a = B[i].s;
        if(a==-1) {
            i++;
            continue;
        }
        j = i+1;
        while(j<n && (a==B[j].s || B[j].s==-1)) j++;
        if(j==n) break;
        ans1 = ans1 + B[i].f*B[j].f;
        B[j].s = -1;
        B[i].s = -1;
        i++;
    }
    ans = max(ans,ans1);
    cout << ans << endl;
}

int main()
{
    Boost;
    Crack();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define Boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

void Print(vector <long> &A) {
    int n = A.size();
    for(int i=0;i<n;i++) cout << A[i] << " \n"[i==n-1];
}

int Max3(int a,int b,int c) {
    return max(max(a,b),c);
}

int Max4(int a,int b,int c,int d) {
    return max(max(a,b),max(c,d));
}

void Crack() {
    int r,g,b;
    cin >> r >> g >> b;
    vector <int> R(r);
    vector <int> G(g);
    vector <int> B(b);
    for(int i=0;i<r;i++) cin >> R[i];
    for(int i=0;i<g;i++) cin >> G[i];
    for(int i=0;i<b;i++) cin >> B[i];

    sort(R.begin(),R.end(),greater<int>());
    sort(G.begin(),G.end(),greater<int>());
    sort(B.begin(),B.end(),greater<int>());

    int DP[r+1][g+1][b+1];
    for(int i=0;i<=r;i++) DP[i][0][0] = 0;
    for(int i=0;i<=g;i++) DP[0][i][0] = 0;
    for(int i=0;i<=b;i++) DP[0][0][i] = 0;

    for(int i=1;i<=r;i++) for(int j=1;j<=g;j++) DP[i][j][0] = Max3(DP[i-1][j-1][0]+R[i-1]*G[j-1],DP[i-1][j][0],DP[i][j-1][0]);
    for(int i=1;i<=b;i++) for(int j=1;j<=g;j++) DP[0][j][i] = Max3(DP[0][j-1][i-1]+B[i-1]*G[j-1],DP[0][j][i-1],DP[0][j-1][i]);
    for(int i=1;i<=r;i++) for(int j=1;j<=b;j++) DP[i][0][j] = Max3(DP[i-1][0][j-1]+R[i-1]*B[j-1],DP[i-1][0][j],DP[i][0][j-1]);

    for(int i=1;i<=r;i++) {
        for(int j=1;j<=g;j++) {
            for(int k=1;k<=b;k++) {
                DP[i][j][k] = Max4(DP[i-1][j-1][k-1],DP[i-1][j-1][k]+R[i-1]*G[j-1],DP[i][j-1][k-1]+G[j-1]*B[k-1],DP[i-1][j][k-1]+R[i-1]*B[k-1]);
                DP[i][j][k] = Max4(DP[i][j][k],DP[i-1][j][k],DP[i][j-1][k],DP[i][j][k-1]);
            }
        }
    }
    cout << DP[r][g][b] << endl;
}

int main()
{
    Boost;
    Crack();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define Boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

void Print(vector <long> &A) {
    int n = A.size();
    for(int i=0;i<n;i++) cout << A[i] << " \n"[i==n-1];
}

bool sortbydec(const pair<int,int> &a,const pair<int,int> &b){
    if(a.f==b.f) return(a.s>b.s);
    return(a.f>b.f);
}

void Crack() {
    int r,g,b,a;
    cin >> r >> g >> b;
    vector <pair<int,int>> A(r+g+b);
    int c = 0;
    if(r>g+b) c = 1;
    if(b>g+r) c = 2;
    if(g>r+b) c = 3;
    vector <pair<int,int>> B(r+g+b);
    for(int i=0;i<r;i++) {
        cin >> a;
        A.pb(mp(a,1));
        if(c==1) B.pb(mp(a,1));
        else if(c==2) B.pb(mp(a,2));
        else if(c==3) B.pb(mp(a,2));
    }
    for(int i=r;i<r+g;i++){
        cin >> a;
        A.pb(mp(a,2));
        if(c==1) B.pb(mp(a,2));
        else if(c==2) B.pb(mp(a,2));
        else if(c==3) B.pb(mp(a,1));
    }
    for(int i=r+g;i<r+g+b;i++) {
        cin >> a;
        A.pb(mp(a,3));
        if(c==1) B.pb(mp(a,2));
        else if(c==2) B.pb(mp(a,1));
        else if(c==3) B.pb(mp(a,2));
    }
    sort(A.begin(),A.end(),sortbydec);
    sort(B.begin(),B.end(),sortbydec);
    int n = r+g+b;
    long long ans = 0,ans1 = 0;
    int i,j;
    i = 0;
    while(i<n) {
        a = A[i].s;
        if(a==-1) {
            i++;
            continue;
        }
        j = i+1;
        while(j<n && (a==A[j].s || A[j].s==-1)) j++;
        if(j==n) break;
        ans = ans + A[i].f*A[j].f;
        A[j].s = -1;
        A[i].s = -1;
        i++;
    }
    i = 0;
    while(i<n) {
        a = B[i].s;
        if(a==-1) {
            i++;
            continue;
        }
        j = i+1;
        while(j<n && (a==B[j].s || B[j].s==-1)) j++;
        if(j==n) break;
        ans1 = ans1 + B[i].f*B[j].f;
        B[j].s = -1;
        B[i].s = -1;
        i++;
    }
    ans = max(ans,ans1);
    cout << ans << endl;
}

int main()
{
    Boost;
    Crack();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define Boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

void Print(vector <long> &A) {
    int n = A.size();
    for(int i=0;i<n;i++) cout << A[i] << " \n"[i==n-1];
}

bool sortbydec(const pair<int,int> &a,const pair<int,int> &b){
    if(a.f==b.f) return(a.s>b.s);
    return(a.f>b.f);
}

void Crack() {
    int r,g,b,a;
    cin >> r >> g >> b;
    vector <pair<int,int>> A(r+g+b);
    for(int i=0;i<r;i++) {
        cin >> a;
        A.pb(mp(a,1));
    }
    for(int i=r;i<r+g;i++){
        cin >> a;
        A.pb(mp(a,2));
    }
    for(int i=r+g;i<r+g+b;i++) {
        cin >> a;
        A.pb(mp(a,3));
    }
    sort(A.begin(),A.end(),sortbydec);
    int n = r+g+b;
    long long ans = 0;
    int i,j;
    i = 0;
    while(i<n) {
        a = A[i].s;
        if(a==-1) {
            i++;
            continue;
        }
        j = i+1;
        while(j<n && (a==A[j].s || A[j].s==-1)) j++;
        if(j==n) break;
        ans = ans + A[i].f*A[j].f;
        A[j].s = -1;
        A[i].s = -1;
        i++;
    }
    cout << ans << endl;
}

int main()
{
    Boost;
    Crack();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define Boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

void Print(vector <long> &A) {
    int n = A.size();
    for(int i=0;i<n;i++) cout << A[i] << " \n"[i==n-1];
}

bool sortbydec(const pair<int,int> &a,const pair<int,int> &b){
    return(a.first>b.first);
}

void Crack() {
    long r,g,b,a;
    cin >> r >> g >> b;
    vector <pair<int,int>> A(r+g+b);
    for(int i=0;i<r;i++) {
        cin >> a;
        A.pb(mp(a,1));
    }
    for(int i=r;i<r+g;i++){
        cin >> a;
        A.pb(mp(a,2));
    }
    for(int i=r+g;i<r+g+b;i++) {
        cin >> a;
        A.pb(mp(a,3));
    }
    sort(A.begin(),A.end(),sortbydec);
    int n = A.size();
    long long ans = 0;
    int i,j;
    i = 0;
    while(i<n) {
        a = A[i].s;
        if(a==-1) {
            i++;
            continue;
        }
        j = i+1;
        while(j<n && (a==A[j].s || A[j].s==-1)) j++;
        if(j==n) break;
        ans += A[i].f*A[j].f;
        A[j].s = -1;
        i++;
    }

    cout << ans << endl;
}

int main()
{
    Boost;
    Crack();
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <map>
#include <limits.h>
#include <cmath>
#include <cstring>

using namespace std;

#define mod (1000000007)
typedef uint64_t  ll;

int main() {
  string str;
  cin >> str;
  int n = (int)str.length();
  map<char,int> cm;
  int maxl = 0;
  char maxc = '\n';
  for (int i = 0; i < str.length(); i++) {
    cm[str[i]] += 1;
    if (maxl < cm[str[i]]) {
      maxl = cm[str[i]];
      maxc = str[i];
    }
  }

  vector<int> primes;
  vector<bool> arr(n+1, true);
  arr[2] = true;
  for (int i = 2; i < n+1; i++) {
    if (arr[i]) {
      if (i*2 <= n) {
        primes.push_back(i);
      }
      for (int j = 2*i; j < arr.size(); j+=i) {
        if (i*2 <= n && !count(primes.begin(), primes.end(), j)) {
          primes.push_back(j);
        }
        arr[j] = false;
      }
    }
  }

  if (maxl < primes.size()) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  vector<char> ans(n, '.');

  for (int i = 0; i < primes.size(); i++) {
    ans[primes[i]-1] = maxc;
    cm[maxc] -= 1;
  }

  for (int i = 0 ; i < n; i++) {
    if (ans[i] == '.') {
      for (auto a : cm) {
        if (a.second > 0) {
          ans[i] = a.first;
          cm[a.first] -= 1;
          break;
        }
      }
    }
  }
  for (auto c : ans) {
    cout << c ;
  }
  cout << "\n";
  return 0;
}


#include<bits/stdc++.h>
#define M1 1000000007
#define M2 998244353
#define ll long long int
#define N (int)1e5+3
#define test(t) while(t--)
#define PI acos(-1.0)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mii map<int,int>
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repp(i,b,a) for(ll i=b-1;i>=a;i--)
#define clr(ar, val) memset(ar, val, sizeof(ar))
#define F first
#define S second
#define PB push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define V(a) vector<a>
#define M(a,b) map<a,b>
#define endl '\n'
#define all(x) begin(x),end(x)
#define allr(x) rbegin(x),rend(x)
#define pr(a) cout<<a<<endl;
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int dx[4] = { 0, -1, 0, 1 };
const int dy[4] = { -1, 0, 1, 0 };
using namespace std;

ll CalculateMex(set<ll> Set){
    ll Mex = 0;
    while(Set.find(Mex)!=Set.end()){
        Mex++;
    }
    return Mex;
}

inline void INP()
{
	#ifndef ONLINE_JUDGE
	    freopen("input.txt","r",stdin);
	    freopen("output.txt","w",stdout);
	#endif
}

vector<ll> primes;
void prime(ll n){
    bool a[n+1];
    primes.PB(2);
    for(ll i=2;i<=n;i+=2) a[i] = true;
    for(ll i=3;i<=n;i+=2){
        if(a[i] == false){
            a[i] = true;
            primes.PB(i);
            for(ll j=i*i;j<=n;j+=2*i){
                a[j] = true;
            }
        }
    }
}
void solve()
{
    prime(1002);
    string s;
    cin >> s;
    ll n = s.size();
    map<char,ll> cf;
    rep(i,0,n){
        cf[s[i]]++;
    }
    // for(auto i:cf) cout << i.F << " " << i.S << endl;
    // for(auto j:fc) {
    //     cout << j.F << " ";
    //     for(char p:j.S) cout << p << " ";
    //     cout << endl;
    // }
    char a[n+1];
    rep(i,1,n+1) a[i] = '\0';
    ll ct = 1;
    ll l1 = ub(all(primes),n) - primes.begin();
    ll l2 = ub(all(primes),n/2) - primes.begin();
    l1--;l2--;
    ll l = (l1 - l2) + 1;
    if (l == n && l == cf.size()){
        cout << "YES" << endl;
        cout << s << endl;
        return;
    }
    char rp = '\0';
    ll t =0;
    // cout << l2<< " " << l1 << endl;
    // rep(i,l2+1,l1+1){
    //     cout << primes[i] << endl;
    // }
    for(auto i:cf){
        char p = i.F;
        if (i.S >= (n-l)){
            rp = p;
            t = i.S;
            // cout << "hi " << rp<< endl;
            continue;
        }
        ll ct = l2+1;
        while (l>1 && i.S>0){
            a[primes[ct]] = i.F;
            i.S--;
            ct++;
            l--;
            if (ct == l1+1) break;
        }
        // rep(i,1,n+1) cout << a[i];
        // cout << endl;
        if (i.S != 0 && l == 1){
            a[1] = i.F;
            l--;
            i.S--;
        }
    }
    if (rp == '\0'){
        cout << "NO" <<endl;
        return;
    }
    rep(i,1,n+1){
        if (a[i] == '\0'){
            if (t == 0){
                cout << "NO" <<endl;
                return;
            }
            a[i] = rp;
            t--;
        }
    }
    cout << "YES" << endl;
    rep(i,1,n+1) cout << a[i];

}

int32_t main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    // cin>>t;
    test(t){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
#define M1 1000000007
#define M2 998244353
#define ll long long int
#define N (int)1e5+3
#define test(t) while(t--)
#define PI acos(-1.0)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mii map<int,int>
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repp(i,b,a) for(ll i=b-1;i>=a;i--)
#define clr(ar, val) memset(ar, val, sizeof(ar))
#define F first
#define S second
#define PB push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define V(a) vector<a>
#define M(a,b) map<a,b>
#define endl '\n'
#define all(x) begin(x),end(x)
#define allr(x) rbegin(x),rend(x)
#define pr(a) cout<<a<<endl;
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int dx[4] = { 0, -1, 0, 1 };
const int dy[4] = { -1, 0, 1, 0 };
using namespace std;

ll CalculateMex(set<ll> Set){
    ll Mex = 0;
    while(Set.find(Mex)!=Set.end()){
        Mex++;
    }
    return Mex;
}

inline void INP()
{
	#ifndef ONLINE_JUDGE
	    freopen("input.txt","r",stdin);
	    freopen("output.txt","w",stdout);
	#endif
}

vector<ll> primes;
void prime(ll n){
    ll g[n+1]={};
    primes.PB(2);
    for(ll i=2;i<=n;i+=2) g[i] = 1;
    for(ll i=3;i<=n;i+=2){
        if(g[i] == 0){
            g[i] = 1;
            primes.PB(i);
            for(ll j=i*i;j<=n;j+=2*i){
                g[j] = 1;
            }
        }
    }
}
void solve()
{
    prime(1002);
    string s;
    cin >> s;
    ll n = s.size();
    map<char,ll> cf;
    rep(i,0,n){
        cf[s[i]]++;
    }
    // for(auto i:cf) cout << i.F << " " << i.S << endl;
    // for(auto j:fc) {
    //     cout << j.F << " ";
    //     for(char p:j.S) cout << p << " ";
    //     cout << endl;
    // }
    char a[n+1];
    rep(i,1,n+1) a[i] = 'A';
    // ll ct = 1;
    ll l1 = ub(all(primes),n) - primes.begin();
    ll l2 = ub(all(primes),n/2) - primes.begin();
    l1--;l2--;
    ll l = (l1 - l2) + 1;
    if (l == n && l == cf.size()){
        cout << "YES" << endl;
        cout << s << endl;
        return;
    }
    char rp = 'A';
    ll t =0;
    // cout << l2<< " " << l1 << endl;
    // cout << n << endl;
    // rep(i,l2+1,l1+1){
    //     cout << primes[i] << endl;
    // }
    ll z = n-l;
    ll ct = l2+1;
    for(auto i:cf){
        // cout << i.F << " " << i.S << " " << n-l << endl;
        if (i.S >= z){
            // cout << "yoman" << endl;
            rp = i.F;
            t = i.S;
            // cout << "hi " << rp<< endl;
            continue;
        }

        while (l>1 && i.S>0){
            a[primes[ct]] = i.F;
            // cout << a[primes[ct]] << " " << primes[ct] << endl;
            i.S--;
            ct++;
            l--;
        }

        if (i.S != 0 && l == 1){
            a[1] = i.F;
            l--;
            i.S--;
        }
    }
    // rep(i,1,n+1) cout << a[i];
        // cout << endl;
    if (rp == 'A'){
        cout << "NO" <<endl;
        return;
    }
    rep(i,1,n+1){
        if (a[i] == 'A'){
            if (t == 0){

                cout << "NO" <<endl;
                return;
            }
            a[i] = rp;
            t--;
        }
    }
    cout << "YES" << endl;
    rep(i,1,n+1) cout << a[i];

}

int32_t main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    // cin>>t;
    test(t){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
#define M1 1000000007
#define M2 998244353
#define ll long long int
#define N (int)1e5+3
#define test(t) while(t--)
#define PI acos(-1.0)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mii map<int,int>
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repp(i,b,a) for(ll i=b-1;i>=a;i--)
#define clr(ar, val) memset(ar, val, sizeof(ar))
#define F first
#define S second
#define PB push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define V(a) vector<a>
#define M(a,b) map<a,b>
#define endl '\n'
#define all(x) begin(x),end(x)
#define allr(x) rbegin(x),rend(x)
#define pr(a) cout<<a<<endl;
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int dx[4] = { 0, -1, 0, 1 };
const int dy[4] = { -1, 0, 1, 0 };
using namespace std;

ll CalculateMex(set<ll> Set){
    ll Mex = 0;
    while(Set.find(Mex)!=Set.end()){
        Mex++;
    }
    return Mex;
}

inline void INP()
{
	#ifndef ONLINE_JUDGE
	    freopen("input.txt","r",stdin);
	    freopen("output.txt","w",stdout);
	#endif
}

vector<ll> primes;
void prime(ll n){
    ll g[n+1];
    primes.PB(2);
    for(ll i=2;i<=n;i+=2) g[i] = 1;
    for(ll i=3;i<=n;i+=2){
        if(g[i] == 0){
            g[i] = 1;
            primes.PB(i);
            for(ll j=i*i;j<=n;j+=2*i){
                g[j] = 1;
            }
        }
    }
}
void solve()
{
    prime(1002);
    string s;
    cin >> s;
    ll n = s.size();
    map<char,ll> cf;
    rep(i,0,n){
        cf[s[i]]++;
    }
    // for(auto i:cf) cout << i.F << " " << i.S << endl;
    // for(auto j:fc) {
    //     cout << j.F << " ";
    //     for(char p:j.S) cout << p << " ";
    //     cout << endl;
    // }
    char a[n+1];
    rep(i,1,n+1) a[i] = 'A';
    // ll ct = 1;
    ll l1 = ub(all(primes),n) - primes.begin();
    ll l2 = ub(all(primes),n/2) - primes.begin();
    l1--;l2--;
    ll l = (l1 - l2) + 1;
    if (l == n && l == cf.size()){
        cout << "YES" << endl;
        cout << s << endl;
        return;
    }
    char rp = 'A';
    ll t =0;
    // cout << l2<< " " << l1 << endl;
    // cout << n << endl;
    // rep(i,l2+1,l1+1){
    //     cout << primes[i] << endl;
    // }
    ll z = n-l;
    ll ct = l2+1;
    for(auto i:cf){
        // cout << i.F << " " << i.S << " " << n-l << endl;
        if (i.S >= z){
            // cout << "yoman" << endl;
            rp = i.F;
            t = i.S;
            // cout << "hi " << rp<< endl;
            continue;
        }

        while (l>1 && i.S>0){
            a[primes[ct]] = i.F;
            // cout << a[primes[ct]] << " " << primes[ct] << endl;
            i.S--;
            ct++;
            l--;
        }

        if (i.S != 0 && l == 1){
            a[1] = i.F;
            l--;
            i.S--;
        }
    }
    // rep(i,1,n+1) cout << a[i];
        // cout << endl;
    if (rp == 'A'){
        cout << "NO" <<endl;
        return;
    }
    rep(i,1,n+1){
        if (a[i] == 'A'){
            if (t == 0){

                cout << "NO" <<endl;
                return;
            }
            a[i] = rp;
            t--;
        }
    }
    cout << "YES" << endl;
    rep(i,1,n+1) cout << a[i];

}

int32_t main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    // cin>>t;
    test(t){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
#define M1 1000000007
#define M2 998244353
#define ll long long int
#define N (int)1e5+3
#define test(t) while(t--)
#define PI acos(-1.0)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mii map<int,int>
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repp(i,b,a) for(ll i=b-1;i>=a;i--)
#define clr(ar, val) memset(ar, val, sizeof(ar))
#define F first
#define S second
#define PB push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define V(a) vector<a>
#define M(a,b) map<a,b>
#define endl '\n'
#define all(x) begin(x),end(x)
#define allr(x) rbegin(x),rend(x)
#define pr(a) cout<<a<<endl;
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int dx[4] = { 0, -1, 0, 1 };
const int dy[4] = { -1, 0, 1, 0 };
using namespace std;

ll CalculateMex(set<ll> Set){
    ll Mex = 0;
    while(Set.find(Mex)!=Set.end()){
        Mex++;
    }
    return Mex;
}

inline void INP()
{
	#ifndef ONLINE_JUDGE
	    freopen("input.txt","r",stdin);
	    freopen("output.txt","w",stdout);
	#endif
}

vector<ll> primes;
void prime(ll n){
    bool a[n+1];
    primes.PB(2);
    for(ll i=2;i<=n;i+=2) a[i] = 1;
    for(ll i=3;i<=n;i+=2){
        if(a[i] == 0){
            a[i] = 1;
            primes.PB(i);
            for(ll j=i*i;j<=n;j+=2*i){
                a[j] = 1;
            }
        }
    }
}
void solve()
{
    prime(1002);
    string s;
    cin >> s;
    ll n = s.size();
    map<char,ll> cf;
    rep(i,0,n){
        cf[s[i]]++;
    }
    // for(auto i:cf) cout << i.F << " " << i.S << endl;
    // for(auto j:fc) {
    //     cout << j.F << " ";
    //     for(char p:j.S) cout << p << " ";
    //     cout << endl;
    // }
    char a[n+1];
    rep(i,1,n+1) a[i] = '\0';
    ll ct = 1;
    ll l1 = ub(all(primes),n) - primes.begin();
    ll l2 = ub(all(primes),n/2) - primes.begin();
    l1--;l2--;
    ll l = (l1 - l2) + 1;
    if (l == n && l == cf.size()){
        cout << "YES" << endl;
        cout << s << endl;
        return;
    }
    char rp = '\0';
    ll t =0;
    // cout << l2<< " " << l1 << endl;
    // rep(i,l2+1,l1+1){
    //     cout << primes[i] << endl;
    // }
    for(auto i:cf){
        char p = i.F;
        if (i.S >= (n-l)){
            rp = p;
            t = i.S;
            // cout << "hi " << rp<< endl;
            continue;
        }
        ll ct = l2+1;
        while (l>1 && i.S>0){
            a[primes[ct]] = i.F;
            i.S--;
            ct++;
            l--;
            if (ct == l1+1) break;
        }
        // rep(i,1,n+1) cout << a[i];
        // cout << endl;
        if (i.S != 0 && l == 1){
            a[1] = i.F;
            l--;
            i.S--;
        }
    }
    if (rp == '\0'){
        cout << "NO" <<endl;
        return;
    }
    rep(i,1,n+1){
        if (a[i] == '\0'){
            if (t == 0){
                cout << "NO" <<endl;
                return;
            }
            a[i] = rp;
            t--;
        }
    }
    cout << "YES" << endl;
    rep(i,1,n+1) cout << a[i];

}

int32_t main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    // cin>>t;
    test(t){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
#define M1 1000000007
#define M2 998244353
#define ll long long int
#define N (int)1e5+3
#define test(t) while(t--)
#define PI acos(-1.0)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mii map<int,int>
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repp(i,b,a) for(ll i=b-1;i>=a;i--)
#define clr(ar, val) memset(ar, val, sizeof(ar))
#define F first
#define S second
#define PB push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define V(a) vector<a>
#define M(a,b) map<a,b>
#define endl '\n'
#define all(x) begin(x),end(x)
#define allr(x) rbegin(x),rend(x)
#define pr(a) cout<<a<<endl;
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int dx[4] = { 0, -1, 0, 1 };
const int dy[4] = { -1, 0, 1, 0 };
using namespace std;

ll CalculateMex(set<ll> Set){
    ll Mex = 0;
    while(Set.find(Mex)!=Set.end()){
        Mex++;
    }
    return Mex;
}

inline void INP()
{
	#ifndef ONLINE_JUDGE
	    freopen("input.txt","r",stdin);
	    freopen("output.txt","w",stdout);
	#endif
}

vector<ll> primes;
void prime(ll n){
    bool g[n+1];
    primes.PB(2);
    for(ll i=2;i<=n;i+=2) g[i] = true;
    for(ll i=3;i<=n;i+=2){
        if(g[i] == false){
            g[i] = true;
            primes.PB(i);
            for(ll j=i*i;j<=n;j+=2*i){
                g[j] = true;
            }
        }
    }
}
void solve()
{
    prime(1002);
    string s;
    cin >> s;
    ll n = s.size();
    map<char,ll> cf;
    rep(i,0,n){
        cf[s[i]]++;
    }
    // for(auto i:cf) cout << i.F << " " << i.S << endl;
    // for(auto j:fc) {
    //     cout << j.F << " ";
    //     for(char p:j.S) cout << p << " ";
    //     cout << endl;
    // }
    char a[n+1];
    rep(i,1,n+1) a[i] = 'A';
    // ll ct = 1;
    ll l1 = ub(all(primes),n) - primes.begin();
    ll l2 = ub(all(primes),n/2) - primes.begin();
    l1--;l2--;
    ll l = (l1 - l2) + 1;
    if (l == n && l == cf.size()){
        cout << "YES" << endl;
        cout << s << endl;
        return;
    }
    char rp = 'A';
    ll t =0;
    // cout << l2<< " " << l1 << endl;
    // cout << n << endl;
    // rep(i,l2+1,l1+1){
    //     cout << primes[i] << endl;
    // }
    ll z = n-l;
    ll ct = l2+1;
    for(auto i:cf){
        // cout << i.F << " " << i.S << " " << n-l << endl;
        if (i.S >= z){
            // cout << "yoman" << endl;
            rp = i.F;
            t = i.S;
            // cout << "hi " << rp<< endl;
            continue;
        }

        while (l>1 && i.S>0){
            a[primes[ct]] = i.F;
            // cout << a[primes[ct]] << " " << primes[ct] << endl;
            i.S--;
            ct++;
            l--;
        }

        if (i.S != 0 && l == 1){
            a[1] = i.F;
            l--;
            i.S--;
        }
    }
    // rep(i,1,n+1) cout << a[i];
        // cout << endl;
    if (rp == 'A'){
        cout << "NO" <<endl;
        return;
    }
    rep(i,1,n+1){
        if (a[i] == 'A'){
            if (t == 0){

                cout << "NO" <<endl;
                return;
            }
            a[i] = rp;
            t--;
        }
    }
    cout << "YES" << endl;
    rep(i,1,n+1) cout << a[i];

}

int32_t main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    // cin>>t;
    test(t){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
#define M1 1000000007
#define M2 998244353
#define ll long long int
#define N (int)1e5+3
#define test(t) while(t--)
#define PI acos(-1.0)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mii map<int,int>
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repp(i,b,a) for(ll i=b-1;i>=a;i--)
#define clr(ar, val) memset(ar, val, sizeof(ar))
#define F first
#define S second
#define PB push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define V(a) vector<a>
#define M(a,b) map<a,b>
#define endl '\n'
#define all(x) begin(x),end(x)
#define allr(x) rbegin(x),rend(x)
#define pr(a) cout<<a<<endl;
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int dx[4] = { 0, -1, 0, 1 };
const int dy[4] = { -1, 0, 1, 0 };
using namespace std;

ll CalculateMex(set<ll> Set){
    ll Mex = 0;
    while(Set.find(Mex)!=Set.end()){
        Mex++;
    }
    return Mex;
}

inline void INP()
{
	#ifndef ONLINE_JUDGE
	    freopen("input.txt","r",stdin);
	    freopen("output.txt","w",stdout);
	#endif
}

vector<ll> primes;
void prime(ll n){
    bool a[n+1];
    primes.PB(2);
    for(ll i=2;i<=n;i+=2) a[i] = true;
    for(ll i=3;i<=n;i+=2){
        if(a[i] == false){
            a[i] = true;
            primes.PB(i);
            for(ll j=i*i;j<=n;j+=2*i){
                a[j] = true;
            }
        }
    }
}
void solve()
{
    prime(1002);
    string s;
    cin >> s;
    ll n = s.size();
    map<char,ll> cf;
    rep(i,0,n){
        cf[s[i]]++;
    }
    // for(auto i:cf) cout << i.F << " " << i.S << endl;
    // for(auto j:fc) {
    //     cout << j.F << " ";
    //     for(char p:j.S) cout << p << " ";
    //     cout << endl;
    // }
    char a[n+1];
    rep(i,1,n+1) a[i] = 'A';
    // ll ct = 1;
    ll l1 = ub(all(primes),n) - primes.begin();
    ll l2 = ub(all(primes),n/2) - primes.begin();
    l1--;l2--;
    ll l = (l1 - l2) + 1;
    if (l == n && l == cf.size()){
        cout << "YES" << endl;
        cout << s << endl;
        return;
    }
    char rp = 'A';
    ll t =0;
    // cout << l2<< " " << l1 << endl;
    // cout << n << endl;
    // rep(i,l2+1,l1+1){
    //     cout << primes[i] << endl;
    // }
    ll z = n-l;
    ll ct = l2+1;
    for(auto i:cf){
        // cout << i.F << " " << i.S << " " << n-l << endl;
        if (i.S >= z){
            // cout << "yoman" << endl;
            rp = i.F;
            t = i.S;
            // cout << "hi " << rp<< endl;
            continue;
        }

        while (l>1 && i.S>0){
            a[primes[ct]] = i.F;
            // cout << a[primes[ct]] << " " << primes[ct] << endl;
            i.S--;
            ct++;
            l--;
        }

        if (i.S != 0 && l == 1){
            a[1] = i.F;
            l--;
            i.S--;
        }
    }
    // rep(i,1,n+1) cout << a[i];
        // cout << endl;
    if (rp == 'A'){
        cout << "NO" <<endl;
        return;
    }
    rep(i,1,n+1){
        if (a[i] == 'A'){
            if (t == 0){

                cout << "NO" <<endl;
                return;
            }
            a[i] = rp;
            t--;
        }
    }
    cout << "YES" << endl;
    rep(i,1,n+1) cout << a[i];

}

int32_t main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    // cin>>t;
    test(t){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
vector<int> p;
bool prime[1001];
void sie()
{
	fill(prime,prime+1000,1);
	prime[0]=prime[1]=0;
	for(int i=2;i*i<=1000;i++)
	{
		if(prime[i])
		for(int j=i*i;j<=1000;j+=i)
		prime[j]=0;
	}
}
int32_t main()
{
	sie();
	for(int i=2;i<=1000;i++)
	if(prime[i])p.push_back(i);
	string s;
	cin>>s;
	int n=s.length();
	vector<int> h(26);
	for(int i=0;i<n;i++)
	h[s[i]-'a']++;

	vector<bool> alone(n+1);
	alone[1]=1;
	int a=1;
	for(int num:p)
	{
		if(num>n)continue;
		if(num*2>n and num!=2){alone[num]=1;a++;}
	}
	int withtwo=n-a;
	int mx=*max_element(h.begin(),h.end());
	//cout<<withtwo<<"\n";
	if(withtwo>mx)
	{puts("NO");return 0;}

	int pos=max_element(h.begin(),h.end())-h.begin();
	char mxc=pos+'a';
	//cout<<mxc<<"\n";
	vector<char> ans(n+1);
	puts("YES");
	for(int i=1;i<=n;i++)
	{
		if(!alone[i]){ans[i]=mxc;h[pos]--;}
	}

	for(int i=1;i<=n;i++)
	{
		if(alone[i])
		{
			for(int j=0;j<26;j++)
			{
				if(h[j]>0)
				{
					h[j]--;
					ans[i]=(char)(j+'a');
					break;
				}
			}
		}
	}
	for(int i=1;i<=n;i++)cout<<ans[i];

}


#include <bits/stdc++.h>
#include <stdint.h>
#define int long long int
#define float long double
#define pb push_back
#define maxv *max_element
#define des greater<int>()
#define mp make_pair
#define mod 1000000007
using namespace std;

const int N=1000;
vector<int> prime[N];

int32_t main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	for(int i = 2;i < N; ++i)if(prime[i].empty())
        for(int j = i; j < N; j += i){
            prime[j].push_back(i);
        }
	int t=1;
	//cin>>t;
	while(t--){
		int n;
		string s;
		cin>>s;
		n=s.size();
		int h=n/2;
		int npp=1;
		vector<int>vp;
		vp.pb(0);
		for(int i=h+1;i<=n;i++){
			if(prime[i][0]==i){
				npp++;
				vp.pb(i-1);
			}
		}
		int mx=0;char c;
		map<char,int>m;
		for(int i=0;i<n;i++){
			m[s[i]]++;
			if(m[s[i]]>mx){
				mx=max(mx,m[s[i]]);
				c=s[i];
			}
		}
		int spp=n-npp;
		if(spp<=mx){
			cout<<"YES"<<endl;
			string as;
			for(int i=0;i<n;i++)
				as.pb('X');
			//cout<<as<<" ^ ";
			m[c]=m[c]-spp;
			string nws;
			for(auto x:m){
				for(int i=0;i<x.second;i++)
					nws.pb(x.first);
			}
			//cout<<nws<<" & ";
			for(int i=0;i<vp.size();i++){
				as[vp[i]]=nws[i];
			}
			//cout<<as<<" $ ";
			for(int i=0;i<n;i++){
				if(as[i]=='X')
					as[i]=c;
			}
			cout<<as<<endl;
		}
		else
			cout<<"NO"<<endl;
	}
}


#include <bits/stdc++.h>
#include <stdint.h>
#define int long long int
#define float long double
#define pb push_back
#define maxv *max_element
#define des greater<int>()
#define mp make_pair
#define mod 1000000007
using namespace std;

const int N=1010;
vector<int> prime[N];

int32_t main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	for(int i = 2;i < N; ++i)if(prime[i].empty())
        for(int j = i; j < N; j += i){
            prime[j].push_back(i);
        }
	int t=1;
	//cin>>t;
	while(t--){
		int n;
		string s;
		cin>>s;
		n=s.size();
		/*if(s[0]=='e'&&s[4]=='u'&&s[9]=='r'){
			cout<<"n "<<n<<endl;
			//cout<<"npp "<<npp<<endl;
			//cout<<"spp "<<spp<<endl;
			//cout<<"mx "<<mx<<endl;
			//cout<<"c: "<<c<<endl;
		}*/
		int h=n/2;
		int npp=1;
		vector<int>vp;
		vp.pb(0);
		for(int i=h+1;i<=n;i++){
			if(prime[i][0]==i){
				npp++;
				vp.pb(i-1);
			}
		}
		int mx=0;char c;
		map<char,int>m;
		for(int i=0;i<n;i++){
			m[s[i]]++;
			if(m[s[i]]>mx){
				mx=m[s[i]];
				c=s[i];
			}
		}
		/*if(s[0]=='e'&&s[4]=='u'&&s[9]=='r'){
			cout<<"n "<<n<<endl;
			cout<<"npp "<<npp<<endl;
			//cout<<"spp "<<spp<<endl;
			cout<<"mx "<<mx<<endl;
			cout<<"c: "<<c<<endl;
		}*/
		int spp=n-npp;
		if(spp<=mx){
			cout<<"YES"<<endl;
			string as;
			for(int i=0;i<n;i++)
				as.pb('X');
			//cout<<as<<" ^ ";
			m[c]=m[c]-spp;
			string nws;
			for(auto x:m){
				for(int i=0;i<x.second;i++)
					nws.pb(x.first);
			}
			//cout<<nws<<" & ";
			for(int i=0;i<vp.size();i++){
				as[vp[i]]=nws[i];
			}
			//cout<<as<<" $ ";
			for(int i=0;i<n;i++){
				if(as[i]=='X')
					as[i]=c;
			}
			cout<<as<<endl;
		}
		else
			cout<<"NO"<<endl;
	}
}


#include <bits/stdc++.h>
#include <stdint.h>
#define int long long int
#define float long double
#define pb push_back
#define maxv *max_element
#define des greater<int>()
#define mp make_pair
#define mod 1000000007
using namespace std;

const int N=1010;
vector<int> prime[N];

int32_t main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	for(int i = 2;i < N; ++i)if(prime[i].empty())
        for(int j = i; j < N; j += i){
            prime[j].push_back(i);
        }
	int t=1;
	//cin>>t;
	while(t--){
		int n;
		string s;
		cin>>s;
		n=s.size();
		if(s.size()==1){
			cout<<"YES"<<endl<<s<<endl;
			goto end;
		}
		/*if(s[0]=='e'&&s[4]=='u'&&s[9]=='r'){
			cout<<"n "<<n<<endl;
			//cout<<"npp "<<npp<<endl;
			//cout<<"spp "<<spp<<endl;
			//cout<<"mx "<<mx<<endl;
			//cout<<"c: "<<c<<endl;
		}*/
		int h=n/2;
		int npp=1;
		vector<int>vp;
		vp.pb(0);
		for(int i=h+1;i<=n;i++){
			if(prime[i][0]==i){
				npp++;
				vp.pb(i-1);
			}
		}
		int mx=0;char c;
		map<char,int>m;
		for(int i=0;i<n;i++){
			m[s[i]]++;
			if(m[s[i]]>mx){
				mx=m[s[i]];
				c=s[i];
			}
		}
		/*if(s[0]=='e'&&s[4]=='u'&&s[9]=='r'){
			cout<<"n "<<n<<endl;
			cout<<"npp "<<npp<<endl;
			//cout<<"spp "<<spp<<endl;
			cout<<"mx "<<mx<<endl;
			cout<<"c: "<<c<<endl;
		}*/
		int spp=n-npp;
		if(spp<=mx){
			cout<<"YES"<<endl;
			string as;
			for(int i=0;i<n;i++)
				as.pb('X');
			//cout<<as<<" ^ ";
			m[c]=m[c]-spp;
			string nws;
			for(auto x:m){
				for(int i=0;i<x.second;i++)
					nws.pb(x.first);
			}
			//cout<<nws<<" & ";
			for(int i=0;i<vp.size();i++){
				as[vp[i]]=nws[i];
			}
			//cout<<as<<" $ ";
			for(int i=0;i<n;i++){
				if(as[i]=='X')
					as[i]=c;
			}
			cout<<as<<endl;
		}
		else
			cout<<"NO"<<endl;
	}
	end:
		int bitches=1;
}


#include <bits/stdc++.h>
#include <stdint.h>
#define int long long int
#define float long double
#define pb push_back
#define maxv *max_element
#define des greater<int>()
#define mp make_pair
#define mod 1000000007
using namespace std;

const int N=1000;
vector<int> prime[N];

int32_t main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	for(int i = 2;i < N; ++i)if(prime[i].empty())
        for(int j = i; j < N; j += i){
            prime[j].push_back(i);
        }
	int t=1;
	//cin>>t;
	while(t--){
		int n;
		string s;
		cin>>s;
		n=s.size();
		int h=n/2;
		int npp=1;
		vector<int>vp;
		vp.pb(0);
		for(int i=h+1;i<=n;i++){
			if(prime[i][0]==i){
				npp++;
				vp.pb(i-1);
			}
		}
		int mx=0;char c;
		map<char,int>m;
		for(int i=0;i<n;i++){
			m[s[i]]++;
			if(m[s[i]]>mx){
				mx=m[s[i]];
				c=s[i];
			}
		}
		if(s[0]=='e'&&s[4]=='u'&&s[9]=='r'){
			cout<<"n "<<n<<endl;
			cout<<"npp "<<npp<<endl;
			//cout<<"spp "<<spp<<endl;
			cout<<"mx "<<mx<<endl;
			cout<<"c: "<<c<<endl;
		}
		int spp=n-npp;
		if(spp<=mx){
			cout<<"YES"<<endl;
			string as;
			for(int i=0;i<n;i++)
				as.pb('X');
			//cout<<as<<" ^ ";
			m[c]=m[c]-spp;
			string nws;
			for(auto x:m){
				for(int i=0;i<x.second;i++)
					nws.pb(x.first);
			}
			//cout<<nws<<" & ";
			for(int i=0;i<vp.size();i++){
				as[vp[i]]=nws[i];
			}
			//cout<<as<<" $ ";
			for(int i=0;i<n;i++){
				if(as[i]=='X')
					as[i]=c;
			}
			cout<<as<<endl;
		}
		else
			cout<<"NO"<<endl;
	}
}


#include <bits/stdc++.h>
#include <stdint.h>
#define int long long int
#define float long double
#define pb push_back
#define maxv *max_element
#define des greater<int>()
#define mp make_pair
#define mod 1000000007
using namespace std;

const int N=1010;
vector<int> prime[N];

int32_t main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	for(int i = 2;i < N; ++i)if(prime[i].empty())
        for(int j = i; j < N; j += i){
            prime[j].push_back(i);
        }
	int t=1;
	//cin>>t;
	while(t--){
		int n;
		string s;
		cin>>s;
		n=s.size();
		if(s[0]=='e'&&s[4]=='u'&&s[9]=='r'){
			cout<<"n "<<n<<endl;
			//cout<<"npp "<<npp<<endl;
			//cout<<"spp "<<spp<<endl;
			//cout<<"mx "<<mx<<endl;
			//cout<<"c: "<<c<<endl;
		}
		int h=n/2;
		int npp=1;
		vector<int>vp;
		vp.pb(0);
		for(int i=h+1;i<=n;i++){
			if(prime[i][0]==i){
				npp++;
				vp.pb(i-1);
			}
		}
		int mx=0;char c;
		map<char,int>m;
		for(int i=0;i<n;i++){
			m[s[i]]++;
			if(m[s[i]]>mx){
				mx=m[s[i]];
				c=s[i];
			}
		}
		if(s[0]=='e'&&s[4]=='u'&&s[9]=='r'){
			cout<<"n "<<n<<endl;
			cout<<"npp "<<npp<<endl;
			//cout<<"spp "<<spp<<endl;
			cout<<"mx "<<mx<<endl;
			cout<<"c: "<<c<<endl;
		}
		int spp=n-npp;
		if(spp<=mx){
			cout<<"YES"<<endl;
			string as;
			for(int i=0;i<n;i++)
				as.pb('X');
			//cout<<as<<" ^ ";
			m[c]=m[c]-spp;
			string nws;
			for(auto x:m){
				for(int i=0;i<x.second;i++)
					nws.pb(x.first);
			}
			//cout<<nws<<" & ";
			for(int i=0;i<vp.size();i++){
				as[vp[i]]=nws[i];
			}
			//cout<<as<<" $ ";
			for(int i=0;i<n;i++){
				if(as[i]=='X')
					as[i]=c;
			}
			cout<<as<<endl;
		}
		else
			cout<<"NO"<<endl;
	}
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<sstream>
#include<string>
#include<math.h>
#include<iomanip>
#include<map>
#include<set>
#include<stack>
#include<queue>
#define MAX 1001
using namespace std;

int main() {
	bool flag[MAX];
	for (int i=0; i<MAX; i++) flag[i]=true;
	flag[0]=flag[1]=false;
	for (int i=2; i*i<MAX; i++)
		if(flag[i])
		for (int j=i; j*i<MAX; j++) flag[j*i]=false;

	string s; cin>>s;
	int sz=s.size();
	map<char,int> mp;
	int val=0; char zz;
	for (int i=0; i<sz; i++) {
		char ch=s[i];
		mp[ch]++;
		int cur=mp[ch];
		if(val<cur) {
			zz=ch;
			val=cur;
		}
	}

	queue<int> q;
	queue<int> qq; qq.push(0);
	for (int i=2; i<=sz; i++) {
		if(i*2>sz && flag[i]) qq.push(i-1);
		else q.push(i-1);
	}

	if(val>=q.size()) {
		string ans;
		for (int i=0; i<sz; i++) ans+=' ';
		while(!q.empty()) {
			int cur=q.front(); q.pop();
			ans[cur]=zz; mp[zz]--;
		}
		while(!qq.empty()) {
			int idx=qq.front(); qq.pop();
			for(map<char,int>::iterator it=mp.begin(); it!=mp.end(); it++) {
				int cur=(*it).second;
				if(cur>0) {
					char ch=(*it).first;
					mp[ch]--;
					ans[idx]=ch;
					break;
				}
			}
		}
		cout << "YES" << endl << ans << endl;
	} else cout << "NO" << endl;

	return 0;
}


#include <bits/stdc++.h>
#include <numeric>
#define M 1000000007
#define inf 10000000000001
#define pb push_back
#define mp make_pair
#define forz(i,s,n) for(lli i=s;i<n;i++)
#define fore(i,n,s) for(lli i=n;i>=s;i--)
#define shaktimaan ios_base ::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

#define fast_io                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);

typedef long long int lli;
//typedef pair<long long int, long long int> pll;
typedef unsigned long long int ull;
using namespace std;

lli recpow(lli x, lli n, lli mod)
{
    if (n == 0)
        return 1;
    else if (n % 2 == 0) //n is even
        return recpow((x * x) % mod, n / 2, mod);
    else //n is odd
        return (x * recpow((x * x) % mod, (n - 1) / 2, mod)) % mod;
}

bool sortbysec(const pair<pair<lli, lli>, lli> &a,
               const pair<pair<lli, lli>, lli> &b)
{
    if(a.second==b.second)
    return (a.first.second<b.first.second);
    else
    return (a.second > b.second);
}

string rev(string s)
{
    string t;
    fore(i,s.length()-1,0)
    {
        t.pb(s[i]);
    }
    return t;
}

bool comp(pair<lli, lli> a, pair<lli, lli> b)
{
    if (a.first == b.first)
        return a.second < b.second;
    else
        return a.first > b.first;
}

lli modInverse(lli n, lli p)
{
    return recpow(n, p - 2, p);
}

lli nCr(lli n, lli r, lli p)
{
    // Base case
    if (r == 0)
        return 1;

    // Fill factorial array so that we
    // can find all factorial of r, n
    // and n-r
    lli fac[n + 1];
    fac[0] = 1;
    for (lli i = 1; i <= n; i++)
        fac[i] = fac[i - 1] * i % p;

    return (fac[n] * modInverse(fac[r], p) % p *
            modInverse(fac[n - r], p) % p) %
           p;
}

bool is_prime(lli n)
{
    for(lli i=2;i*i<=n;++i)
    if(n%i==0)
    return false;
    return true;
}

//code begins here
int main()
{
    shaktimaan
    string s;
    cin>>s;
    lli n=s.length();
    char t[n];
    forz(i,0,n)
    t[i]='*';
    vector<lli> p;
    p.pb(1);
    map<char, lli> m;
    forz(i,0,s.length())
    m[s[i]]++;
    forz(i,2,n+1)
    {
        if(is_prime(i) and i*2>n)
        p.pb(i);//cout<<i<<" ";
    }
    lli ma=0;
    char c;
    for(auto it:m)
    {
        if(it.second>ma)
        {
            ma=it.second;
            c=it.first;
        }
    }
    if(ma<n-p.size())
    {
        cout<<"NO\n";
        return 0;
    }
    lli cn=0;
    forz(i,0,p.size())
    {
        lli mi=INT_MAX;
        char c1;
        for(auto it:m)
        {
            if(it.second>0 and it.second<mi)
            {
                mi=it.second;
                c1=it.first;
            }
        }
        t[p[i]-1]=c1;
        m[c1]--;
        // cout<<c1<<" "<<m[c1]<<" ";
    }
    vector<char> rem;
    for(auto it:m)
    {
        if(it.second>0)
        {
            forz(i,0,it.second)
            rem.pb(it.first); //cout<<it.first<<" ";
        }
    }
    cn=0;
    forz(i,0,n)
    if(t[i]=='*')
    t[i]=rem[cn], cn++;
    cout<<"YES\n";
    forz(i,0,n)
    cout<<t[i];
    return 0;
}


#include <bits/stdc++.h>
#include <numeric>
#define M 1000000007
#define inf 10000000000001
#define pb push_back
#define mp make_pair
#define forz(i,s,n) for(lli i=s;i<n;i++)
#define fore(i,n,s) for(lli i=n;i>=s;i--)
#define shaktimaan ios_base ::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

#define fast_io                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);

typedef long long int lli;
//typedef pair<long long int, long long int> pll;
typedef unsigned long long int ull;
using namespace std;

lli recpow(lli x, lli n, lli mod)
{
    if (n == 0)
        return 1;
    else if (n % 2 == 0) //n is even
        return recpow((x * x) % mod, n / 2, mod);
    else //n is odd
        return (x * recpow((x * x) % mod, (n - 1) / 2, mod)) % mod;
}

bool sortbysec(const pair<pair<lli, lli>, lli> &a,
               const pair<pair<lli, lli>, lli> &b)
{
    if(a.second==b.second)
    return (a.first.second<b.first.second);
    else
    return (a.second > b.second);
}

string rev(string s)
{
    string t;
    fore(i,s.length()-1,0)
    {
        t.pb(s[i]);
    }
    return t;
}

bool comp(pair<lli, lli> a, pair<lli, lli> b)
{
    if (a.first == b.first)
        return a.second < b.second;
    else
        return a.first > b.first;
}

lli modInverse(lli n, lli p)
{
    return recpow(n, p - 2, p);
}

lli nCr(lli n, lli r, lli p)
{
    // Base case
    if (r == 0)
        return 1;

    // Fill factorial array so that we
    // can find all factorial of r, n
    // and n-r
    lli fac[n + 1];
    fac[0] = 1;
    for (lli i = 1; i <= n; i++)
        fac[i] = fac[i - 1] * i % p;

    return (fac[n] * modInverse(fac[r], p) % p *
            modInverse(fac[n - r], p) % p) %
           p;
}

bool is_prime(lli n)
{
    for(lli i=2;i*i<=n;++i)
    if(n%i==0)
    return false;
    return true;
}

//code begins here
int main()
{
    shaktimaan
    string s;
    cin>>s;
    lli n=s.length();
    char t[n];
    forz(i,0,n)
    t[i]='*';
    vector<lli> p;
    map<char, lli> m;
    forz(i,0,s.length())
    m[s[i]]++;
    forz(i,2,n+1)
    {
        if(is_prime(i))
        p.pb(i);
    }
    forz(i,0,p.size())
    {
        lli ma=0;
        char c;
        for(auto it:m)
        {
            if(it.second>ma)
            {
                ma=it.second;
                c=it.first;
            }
        }
        for(lli j=1;j*p[i]<=n;++j)
        {
            if(t[j*p[i]-1]=='*')
            {
                t[j*p[i]-1]=c;
                m[c]--;
            }
            if(m[c]<0)
            {
                cout<<"NO\n";
                return 0;
            }
        }
    }
    vector<char> rem;
    for(auto it:m)
    {
        if(it.second>0)
        {
            forz(i,0,it.second)
            rem.pb(it.first);
        }
    }
    lli c=0;
    forz(i,0,n)
    if(t[i]=='*')
    t[i]=rem[c], c++;
    cout<<"YES\n";
    forz(i,0,n)
    cout<<t[i];
    return 0;
}


#include <bits/stdc++.h>
#include <numeric>
#define M 1000000007
#define inf 10000000000001
#define pb push_back
#define mp make_pair
#define forz(i,s,n) for(lli i=s;i<n;i++)
#define fore(i,n,s) for(lli i=n;i>=s;i--)
#define shaktimaan ios_base ::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

#define fast_io                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);

typedef long long int lli;
//typedef pair<long long int, long long int> pll;
typedef unsigned long long int ull;
using namespace std;

lli recpow(lli x, lli n, lli mod)
{
    if (n == 0)
        return 1;
    else if (n % 2 == 0) //n is even
        return recpow((x * x) % mod, n / 2, mod);
    else //n is odd
        return (x * recpow((x * x) % mod, (n - 1) / 2, mod)) % mod;
}

bool sortbysec(const pair<pair<lli, lli>, lli> &a,
               const pair<pair<lli, lli>, lli> &b)
{
    if(a.second==b.second)
    return (a.first.second<b.first.second);
    else
    return (a.second > b.second);
}

string rev(string s)
{
    string t;
    fore(i,s.length()-1,0)
    {
        t.pb(s[i]);
    }
    return t;
}

bool comp(pair<lli, lli> a, pair<lli, lli> b)
{
    if (a.first == b.first)
        return a.second < b.second;
    else
        return a.first > b.first;
}

lli modInverse(lli n, lli p)
{
    return recpow(n, p - 2, p);
}

lli nCr(lli n, lli r, lli p)
{
    // Base case
    if (r == 0)
        return 1;

    // Fill factorial array so that we
    // can find all factorial of r, n
    // and n-r
    lli fac[n + 1];
    fac[0] = 1;
    for (lli i = 1; i <= n; i++)
        fac[i] = fac[i - 1] * i % p;

    return (fac[n] * modInverse(fac[r], p) % p *
            modInverse(fac[n - r], p) % p) %
           p;
}

bool is_prime(lli n)
{
    for(lli i=2;i*i<=n;++i)
    if(n%i==0)
    return false;
    return true;
}

//code begins here
int main()
{
    shaktimaan
    string s;
    cin>>s;
    lli n=s.length();
    char t[n];
    forz(i,0,n)
    t[i]='*';
    vector<lli> p;
    map<char, lli> m;
    forz(i,0,s.length())
    m[s[i]]++;
    forz(i,2,n+1)
    {
        if(is_prime(i))
        p.pb(i);
    }
    forz(i,0,p.size())
    {
        lli ma=0;
        char c;
        for(auto it:m)
        {
            if(it.second>ma)
            {
                ma=it.second;
                c=it.first;
            }
        }
        for(lli j=1;j*p[i]<=n;++j)
        {
            if(t[j*p[i]-1]=='*')
            {
                t[j*p[i]-1]=c;
                m[c]--;
            }
            if(t[j*p[i]-1]!=c || m[c]<0)
            {
                cout<<"NO\n";
                return 0;
            }
        }
    }
    vector<char> rem;
    for(auto it:m)
    {
        if(it.second>0)
        {
            forz(i,0,it.second)
            rem.pb(it.first);
        }
    }
    lli c=0;
    forz(i,0,n)
    if(t[i]=='*')
    t[i]=rem[c], c++;
    cout<<"YES\n";
    forz(i,0,n)
    cout<<t[i];
    return 0;
}


#include <bits/stdc++.h>
#include <numeric>
#define M 1000000007
#define inf 10000000000001
#define pb push_back
#define mp make_pair
#define forz(i,s,n) for(lli i=s;i<n;i++)
#define fore(i,n,s) for(lli i=n;i>=s;i--)
#define shaktimaan ios_base ::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

#define fast_io                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);

typedef long long int lli;
//typedef pair<long long int, long long int> pll;
typedef unsigned long long int ull;
using namespace std;

lli recpow(lli x, lli n, lli mod)
{
    if (n == 0)
        return 1;
    else if (n % 2 == 0) //n is even
        return recpow((x * x) % mod, n / 2, mod);
    else //n is odd
        return (x * recpow((x * x) % mod, (n - 1) / 2, mod)) % mod;
}

bool sortbysec(const pair<pair<lli, lli>, lli> &a,
               const pair<pair<lli, lli>, lli> &b)
{
    if(a.second==b.second)
    return (a.first.second<b.first.second);
    else
    return (a.second > b.second);
}

string rev(string s)
{
    string t;
    fore(i,s.length()-1,0)
    {
        t.pb(s[i]);
    }
    return t;
}

bool comp(pair<lli, lli> a, pair<lli, lli> b)
{
    if (a.first == b.first)
        return a.second < b.second;
    else
        return a.first > b.first;
}

lli modInverse(lli n, lli p)
{
    return recpow(n, p - 2, p);
}

lli nCr(lli n, lli r, lli p)
{
    // Base case
    if (r == 0)
        return 1;

    // Fill factorial array so that we
    // can find all factorial of r, n
    // and n-r
    lli fac[n + 1];
    fac[0] = 1;
    for (lli i = 1; i <= n; i++)
        fac[i] = fac[i - 1] * i % p;

    return (fac[n] * modInverse(fac[r], p) % p *
            modInverse(fac[n - r], p) % p) %
           p;
}

bool is_prime(lli n)
{
    for(lli i=2;i*i<=n;++i)
    if(n%i==0)
    return true;
    return false;
}

//code begins here
int main()
{
    shaktimaan
    string s;
    cin>>s;
    lli n=s.length();
    char t[n];
    forz(i,0,n)
    t[i]='*';
    vector<lli> p;
    map<char, lli> m;
    forz(i,0,s.length())
    m[s[i]]++;
    forz(i,2,n+1)
    {
        if(is_prime(i))
        p.pb(i);
    }
    forz(i,0,p.size())
    {
        lli ma=0;
        char c;
        for(auto it:m)
        {
            if(it.second>ma)
            {
                ma=it.second;
                c=it.first;
            }
        }
        for(lli j=1;j*p[i]<=n;++j)
        {
            if(t[j*p[i]-1]=='*')
            {
                t[j*p[i]-1]=c;
                m[c]--;
            }
            if(m[c]<0)
            {
                cout<<"NO\n";
                return 0;
            }
        }
    }
    vector<char> rem;
    for(auto it:m)
    {
        if(it.second>0)
        {
            forz(i,0,it.second)
            rem.pb(it.first);
        }
    }
    lli c=0;
    forz(i,0,n)
    if(t[i]=='*')
    t[i]=rem[c], c++;
    cout<<"YES\n";
    forz(i,0,n)
    cout<<t[i];
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define all(v) v.begin(),v.end()
#define prec(n) fixed<<setprecision(n)
// declaration shortcuts
typedef long long int ll;
#define int ll
// Constants
constexpr int dx[] = {-1, 0, 1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, -1, 0, 1, 1, -1, 1, -1};
constexpr ll INF = 1999999999999999997;
constexpr int inf= INT_MAX;
constexpr int MAXSIZE = int(1e6)+5;
constexpr auto PI  = 3.14159265358979323846L;
constexpr auto eps = 1e-6;
constexpr auto mod = 1000000007;
constexpr auto maxn = 100006;
//void IOfile(){
//freopen(file_name, reade_mode, stdin);
//freopen(file_name, write_mode, stdout);
//}
void fastio(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
int cnt[26];

bool is(int x){
	for(int i = 2; i * i <= x; i++) if(x % i == 0) return false;
	return true;
 }

int32_t main(){
	fastio();
	string s;
	cin >> s;
	int n = s.length();
	if(n == 1){
		cout << "YES\n";
		cout << s;
		return 0;
	}
	for(int i = 0; i < n; i++){
		cnt[s[i] - 'a']++;
	}
	string ans;
	ans += '*';
	for(int i = 1; i <= n; i++){
		ans += '?';
	}
	for(int i = 2; i <= n; i++){
		if(is(i)){
			set<char>c;
			int k = 0;
			for(int j = i; j <= n; j+=i){
				if(ans[j] != '?') c.insert(ans[j]);
				if(ans[j] == '?') k++;
			}
			if(c.size() == 0){
				int maxi = 0;
				char p;
				for(int l = 0; l < 26; l++){
					if(cnt[l] > maxi){
						maxi = cnt[l];
						p = l;
					}
				}
				if(maxi < k){

					cout << "NO";
					return 0;
				}

				for(int j = i; j <= n; j+=i){
					ans[j] = (p + 'a');
				}
				cnt[p] -= k;

			}else if(c.size() == 1){
				char p = *c.begin();
				if(cnt[p - 'a'] < k){
					cout << "NO";
					return 0;
				}
				cnt[p - 'a'] -= k;
				for(int j = i; j <= n; j+=i){

					ans[j] = p;
				}
			}else{
				cout << "i ran\n";
				cout << "NO";
				return 0;
			}
		}
	}
	for(int i = 0; i < 26; i++){
		if(cnt[i]) ans[1] = (i + 'a');
	}
	cout << "YES\n";
	cout << ans.substr(1);

}


#include<bits/stdc++.h>
#define clr(a) memset(a,0,sizeof(a))
#define ll long long
#define INF 1e9+9
#define endl '\n'
#pragma  warning(disable: 4996)
using namespace std;
const int N = 2e5+ 7;
typedef  pair<int, int>pii;
int Dx[] = { 1,0,-1,0,1,1,-1,-1 };
int Dy[] = { 0,1,0,-1,1,-1,1,-1 };
ll gcd(ll a, ll b) {
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
ll powm(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b % 2)res *= a;
        a *= a;
        b /= 2;

    }
    return res;
}
vector<int>adj[N];
int par[N];
int sz[N];
struct kruskal
{
    void inti(int n) {
        for (int i = 0; i <= n; i++) {
            par[i] = i;
            sz[i] = 1;
        }
    }
    int find(int x) {
        if (x == par[x])return x;
        return par[x] = find(par[x]);
    }
    bool same(int a, int b) {
        return find(a) == find(b);
    }
    void unin(int a, int b) {
        a = find(a);
        b = find(b);
        if (sz[a] < sz[b])swap(a, b);
        par[b] = a;
        sz[a] += b;
    }
};

int prime[1007];
void seivEraston(int n) {
    memset(prime, true, sizeof(prime));
    for (int i = 2; i * i <= n; i++) {
        if (prime[i])
            for (int j = i * i; j <= n; j += i)
                prime[j] = 0;
    }
}
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen("popcorn.in", "r", stdin);
    // freopen("output.txt", "w", stdout);
    string s,str;
    int arr[300] = { 0 };
    cin >> s;
    str = s;
    int n = s.size();
    for (int i = 0; i < n; i++)
       arr[s[i]]++;

    int k = 0;
    for (int i = 0; i < 256; i++)
        if (arr[i] > arr[k]) k = i;

    seivEraston(n);

    prime[1] = true;
    for (int i = 2; i + i <= n; i++)
        prime[i] = false;

    for (int i = 1; i <= n; i++)
        if (!prime[i])
        {
            if (arr[k] == 0)
            {
                cout<<"NO";
                return 0;
            }
            arr[s[i - 1] = k]--;
        }

    cout << "YES\n";
    cout << str;

    return 0;
}


#include<bits/stdc++.h>
#define clr(a) memset(a,0,sizeof(a))
#define ll long long
#define INF 1e9+9
#define endl '\n'
#pragma  warning(disable: 4996)
using namespace std;
const int N = 2e5+ 7;
typedef  pair<int, int>pii;
int Dx[] = { 1,0,-1,0,1,1,-1,-1 };
int Dy[] = { 0,1,0,-1,1,-1,1,-1 };
ll gcd(ll a, ll b) {
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
ll powm(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b % 2)res *= a;
        a *= a;
        b /= 2;

    }
    return res;
}
vector<int>adj[N];
int par[N];
int sz[N];
struct kruskal
{
    void inti(int n) {
        for (int i = 0; i <= n; i++) {
            par[i] = i;
            sz[i] = 1;
        }
    }
    int find(int x) {
        if (x == par[x])return x;
        return par[x] = find(par[x]);
    }
    bool same(int a, int b) {
        return find(a) == find(b);
    }
    void unin(int a, int b) {
        a = find(a);
        b = find(b);
        if (sz[a] < sz[b])swap(a, b);
        par[b] = a;
        sz[a] += b;
    }
};

int prime[1007];
void seivEraston(int n) {
    memset(prime, true, sizeof(prime));
    for (int i = 2; i * i <= n; i++) {
        if (prime[i])
            for (int j = i * i; j <= n; j += i)
                prime[j] = 0;
    }
}
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen("popcorn.in", "r", stdin);
    // freopen("output.txt", "w", stdout);
    string s,str;
    int arr[300] = { 0 };
    cin >> s;
    str = s;
    int n = s.size();
    for (int i = 0; i < n; i++)
       arr[s[i]]++;

    int k = 0;
    for (int i = 0; i < 256; i++)
        if (arr[i] > arr[k]) k = i;

    seivEraston(n);

    prime[1] = true;
    for (int i = 2; i + i <= n; i++)
        prime[i] = false;

    for (int i = 1; i <= n; i++)
        if (!prime[i])
        {
            if (arr[k] == 0)
            {
                cout<<"NO";
                return 0;
            }
            arr[s[i - 1] = k]--;
        }

    k = 0;
    for (int i = 1; i <= n; i++)
        if (prime[i])
        {
            while (arr[k] == 0) k++;
            arr[s[i - 1] = k]--;
        }

    cout << "YES\n";
    cout << s;

    return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long

#define lp(i,n) 	    for(int i=0;i<(int)(n);i++)
#define lpi(i, j, n)    for(int i=(j);i<(int)(n);i++)
#define lpd(i, j, n)    for(int i=(j);i>=(int)(n);i--)

#define all(v)  	 ((v).begin()), ((v).end())
#define sz(v)    	 ((int)((v).size()))
#define clr(v, d)    memset(v, d, sizeof(v))
#define PB           push_back
#define MP           make_pair
#define N 100003

#define PI 3.14159265

using namespace std;

ll nChooseR(int n,int k);
ll gcd(ll a, ll b);
vector<string> split(string target,char c );
bool isPrime(ll g);

int n,k,r,l,t,x,y,m,a;
int ans;
char c[1002];
pair<int,char>p[26];
void setchr(int d,int size){
  lpi(i,1,size){
    if(p[0].first==0){
      cout<<"NO";
      exit(0);
    }
    if(c[d*i]==-1){
      c[d*i]=p[0].second;
      p[0].first--;
    }

  }
}

int main() {
//	freopen("input.txt","r",stdin);
  //freopen("output.txt","w",stdout);
//cout.precision(9);
string s;
cin>>s;
n=sz(s);

lp(i,n){
  p[s[i]-'a'].first++;
  p[s[i]-'a'].second=s[i];
}
sort(p,p+26,greater<pair<int,char>>());

clr(c,-1);
lpi(i,2,n+1){
  if(isPrime(i)){
    setchr(i,n/i +1) ;
    sort(p,p+26,greater<pair<int,char>>());

  }

}
lpi(i,1,n+1){
  if(c[i]==-1){
    lp(j,26){
      if(p[j].first>0){
        c[i]=p[j].second;
        p[j].first--;
        break;
      }

    }

  }

}
cout<<"YES\n";
lp(i,n)cout<<c[i+1];

return 0;

}

ll nChooseR( int n, int k )
{
    if (k > n) return 0;
    if (k * 2 > n) k = n-k;
    if (k == 0) return 1;
   	ll result = n;
    for( int i = 2; i <= k; ++i ) {
        result *= (n-i+1);
        result /= i;
    }
    return result;
}

ll gcd(ll a, ll b){
	return b==0?a:gcd(b,a%b);
	}

vector<string> split(string target,char c ){
	string d="";
	vector<string>arr;
	for(auto n:target)
	{
		if(n!=c)
		d+=n;
		else if(d!="")
		arr.push_back(d),d="";
	}
	if (d!="")
	arr.push_back(d),d="";
	return arr;
}
/*bool isPrime(int h){
     for(int i=0;primes[i]*primes[i]<=h;i++)
     if (h%primes[i]==0)
     return 0;
     return 1;
 }*/
 bool isPrime(ll g){
   if((g%2==0 && g>2) || g==1)return 0;
   for(int i=3;i*i<=g;i+=2)if(g%i==0)return 0;
   return 1;

 }


#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long

#define lp(i,n) 	    for(int i=0;i<(int)(n);i++)
#define lpi(i, j, n)    for(int i=(j);i<(int)(n);i++)
#define lpd(i, j, n)    for(int i=(j);i>=(int)(n);i--)

#define all(v)  	 ((v).begin()), ((v).end())
#define sz(v)    	 ((int)((v).size()))
#define clr(v, d)    memset(v, d, sizeof(v))
#define PB           push_back
#define MP           make_pair
#define N 100003

#define PI 3.14159265

using namespace std;

ll nChooseR(int n,int k);
ll gcd(ll a, ll b);
vector<string> split(string target,char c );
bool isPrime(ll g);

int n,k,r,l,t,x,y,m,a;
int ans;
char c[1002];
pair<int,char>p[26];
void setchr(int d,int size){
  lpi(i,1,size){
    if(p[0].first==0 && c[d*i]==-1){
      cout<<"NO";
      exit(0);
    }
    if(c[d*i]==-1){
      c[d*i]=p[0].second;
      p[0].first--;
    }
    else if(c[i*d]!=p[0].second){
       cout<<"NO";
      exit(0);

    }

  }
}

int main() {
//	freopen("input.txt","r",stdin);
  //freopen("output.txt","w",stdout);
//cout.precision(9);
string s;
cin>>s;
n=sz(s);

lp(i,n){
  p[s[i]-'a'].first++;
  p[s[i]-'a'].second=s[i];
}
sort(p,p+26,greater<pair<int,char>>());

clr(c,-1);
lpi(i,2,n+1){
  if(isPrime(i)){
    if(p[0].first==0)
    sort(p,p+26,greater<pair<int,char>>());
    setchr(i,n/i +1);

  }

}
lpi(i,1,n+1){
  if(c[i]==-1){
    lp(j,26){
      if(p[j].first>0){
        c[i]=p[j].second;
        p[j].first--;
        break;
      }

    }

  }

}
cout<<"YES\n";
lp(i,n)cout<<c[i+1];

return 0;

}

ll nChooseR( int n, int k )
{
    if (k > n) return 0;
    if (k * 2 > n) k = n-k;
    if (k == 0) return 1;
   	ll result = n;
    for( int i = 2; i <= k; ++i ) {
        result *= (n-i+1);
        result /= i;
    }
    return result;
}

ll gcd(ll a, ll b){
	return b==0?a:gcd(b,a%b);
	}

vector<string> split(string target,char c ){
	string d="";
	vector<string>arr;
	for(auto n:target)
	{
		if(n!=c)
		d+=n;
		else if(d!="")
		arr.push_back(d),d="";
	}
	if (d!="")
	arr.push_back(d),d="";
	return arr;
}
/*bool isPrime(int h){
     for(int i=0;primes[i]*primes[i]<=h;i++)
     if (h%primes[i]==0)
     return 0;
     return 1;
 }*/
 bool isPrime(ll g){
   if((g%2==0 && g>2) || g==1)return 0;
   for(int i=3;i*i<=g;i+=2)if(g%i==0)return 0;
   return 1;

 }


#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long

#define lp(i,n) 	    for(int i=0;i<(int)(n);i++)
#define lpi(i, j, n)    for(int i=(j);i<(int)(n);i++)
#define lpd(i, j, n)    for(int i=(j);i>=(int)(n);i--)

#define all(v)  	 ((v).begin()), ((v).end())
#define sz(v)    	 ((int)((v).size()))
#define clr(v, d)    memset(v, d, sizeof(v))
#define PB           push_back
#define MP           make_pair
#define N 100003

#define PI 3.14159265

using namespace std;

ll nChooseR(int n,int k);
ll gcd(ll a, ll b);
vector<string> split(string target,char c );
bool isPrime(ll g);

int n,k,r,l,t,x,y,m,a[26];
int ans;

bool cmp(char& b,char& c){
return a[b-'a']>a[c-'a'];
}
bool chk(string& s,int p){

int c=sz(s);
lpi(i,1,c/p +1){
  if(s[p-1]!=s[p*i -1])return 0;
}
return 1;

}

int main() {
//	freopen("input.txt","r",stdin);
  //freopen("output.txt","w",stdout);
//cout.precision(9);
string s;
cin>>s;
n=sz(s);
lp(i,n)a[s[i]-'a']++;

sort(all(s),cmp);
s=s[n-1]+s.substr(0,n-1);
lpi(i,2,n+1){
if(isPrime(i)){
  if(!chk(s,i))return cout<<"NO",0;
}

}
cout<<"YES\n"<<s;

return 0;

}

ll nChooseR( int n, int k )
{
    if (k > n) return 0;
    if (k * 2 > n) k = n-k;
    if (k == 0) return 1;
   	ll result = n;
    for( int i = 2; i <= k; ++i ) {
        result *= (n-i+1);
        result /= i;
    }
    return result;
}

ll gcd(ll a, ll b){
	return b==0?a:gcd(b,a%b);
	}

vector<string> split(string target,char c ){
	string d="";
	vector<string>arr;
	for(auto n:target)
	{
		if(n!=c)
		d+=n;
		else if(d!="")
		arr.push_back(d),d="";
	}
	if (d!="")
	arr.push_back(d),d="";
	return arr;
}
/*bool isPrime(int h){
     for(int i=0;primes[i]*primes[i]<=h;i++)
     if (h%primes[i]==0)
     return 0;
     return 1;
 }*/
 bool isPrime(ll g){
   if((g%2==0 && g>2) || g==1)return 0;
   for(int i=3;i*i<=g;i+=2)if(g%i==0)return 0;
   return 1;

 }


#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long

#define lp(i,n) 	    for(int i=0;i<(int)(n);i++)
#define lpi(i, j, n)    for(int i=(j);i<(int)(n);i++)
#define lpd(i, j, n)    for(int i=(j);i>=(int)(n);i--)

#define all(v)  	 ((v).begin()), ((v).end())
#define sz(v)    	 ((int)((v).size()))
#define clr(v, d)    memset(v, d, sizeof(v))
#define PB           push_back
#define MP           make_pair
#define N 100003

#define PI 3.14159265

using namespace std;

ll nChooseR(int n,int k);
ll gcd(ll a, ll b);
vector<string> split(string target,char c );
bool isPrime(ll g);

int n,k,r,l,t,x,y,m,a[26];
int ans;

bool cmp(char& b,char& c){
return a[b-'a']>a[c-'a'];
}
bool chk(string& s,int p){

int c=sz(s);
lpi(i,1,c/p +1){
  if(s[p]!=s[p*i])return 0;
}
return 1;

}

int main() {
//	freopen("input.txt","r",stdin);
  //freopen("output.txt","w",stdout);
//cout.precision(9);
string s;
cin>>s;
n=sz(s);
lp(i,n)a[s[i]-'a']++;

sort(all(s),cmp);
s=s[n-1]+s.substr(0,n-1);
lpi(i,2,n+1){
if(isPrime(i)){
  if(!chk(s,i))return cout<<"NO",0;
}

}
cout<<"YES\n"<<s;

return 0;

}

ll nChooseR( int n, int k )
{
    if (k > n) return 0;
    if (k * 2 > n) k = n-k;
    if (k == 0) return 1;
   	ll result = n;
    for( int i = 2; i <= k; ++i ) {
        result *= (n-i+1);
        result /= i;
    }
    return result;
}

ll gcd(ll a, ll b){
	return b==0?a:gcd(b,a%b);
	}

vector<string> split(string target,char c ){
	string d="";
	vector<string>arr;
	for(auto n:target)
	{
		if(n!=c)
		d+=n;
		else if(d!="")
		arr.push_back(d),d="";
	}
	if (d!="")
	arr.push_back(d),d="";
	return arr;
}
/*bool isPrime(int h){
     for(int i=0;primes[i]*primes[i]<=h;i++)
     if (h%primes[i]==0)
     return 0;
     return 1;
 }*/
 bool isPrime(ll g){
   if((g%2==0 && g>2) || g==1)return 0;
   for(int i=3;i*i<=g;i+=2)if(g%i==0)return 0;
   return 1;

 }


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define FastIo ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define endl "\n"
#define N 1005
int prime[N];
void sieve()
{
    for(int i=2; i<N; i++)
        if(!prime[i])
            for(int j=i; j<N; j+=i)
                if(!prime[j])
                    prime[j] = i;
}
int main()
{
	FastIo
	int t=1,n,m,flag,pos,l;
	string s;
	while(t--)
	{
		sieve();
		cin>>s;
		n=s.length();
		int arr[n+1];
		int freq[27];
		char ans[n+1];
		memset(freq,0,sizeof(freq));
		memset(arr,-1,sizeof(arr));
		set<int>st[n];
		m=-1;
		if(n==1)
		{
			cout<<"YES"<<endl;
			cout<<s<<endl;
		}
		else{
			flag=0;
		for(int i=1;i<=n;i++)
		{
			//cout<<i<<" "<<prime[i]<<endl;
			if(prime[i]==i)
			{
				if(arr[i]==-1)
				{
					arr[i]=++m;
					//cout<<m<<endl;
				}
				for(int j=1;j<=(n/i);j++)
				{
					arr[j]=arr[i];
					st[arr[i]].insert(i*j);
				}
			}
		}
		//cout<<m<<endl;
		//cout<<st[0].size()<<endl;
		for(int i=0;i<n;i++)
		{
			freq[s[i]-96]++;
		}
		for(int i=0;i<=m;i++)
		{
			l=0;
			flag=0;
			pos=-1;
			for(int j=1;j<=26;j++)
			{
				if(freq[j]==st[i].size())
				{
					for(auto k:st[i])
					{
						//cout<<i<<" "<<k<<endl;
						ans[k-1]=char(j+96);
					}
					//cout<<ans[4]<<endl;
					freq[j]=0;
					//cout<<j<<endl;
					flag=1;
					pos=-1;
					break;
				}
				else if(freq[j]>st[i].size() && freq[j]>l)
				{
					pos=j;
					//ch=char(j+96);
					l=freq[j];
					flag=1;
				}
			}
			if(flag==0)
				break;
			else if(pos!=-1)
			{
				for(auto k:st[i])
				{
					ans[k-1]=char(pos+96);
					//
				}
				//cout<<pos<<endl;
				freq[pos]-=st[i].size();
			}
		}
		if(flag==0)
			cout<<"NO"<<endl;
		else
		{
			//cout<<freq[25]<<endl;
			cout<<"YES"<<endl;
			for(int i=1;i<=26;i++)
			{
				//cout<<freq[25]<<endl;
				if(freq[i]>0)
				{
					ans[0]=char(i+96);
					break;
				}
			}
			for(int i=0;i<n;i++)
				cout<<ans[i];
			cout<<endl;
		}}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define FastIo ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define endl "\n"
#define N 1005
int prime[N];
void sieve()
{
    for(int i=2; i<N; i++)
        if(!prime[i])
            for(int j=i; j<N; j+=i)
                if(!prime[j])
                    prime[j] = i;
}
int main()
{
	FastIo
	int t=1,n,m,flag,pos,l;
	string s;
	while(t--)
	{
		sieve();
		cin>>s;
		n=s.length();
		int arr[n+1];
		int freq[27];
		char ans[n+1];
		memset(freq,0,sizeof(freq));
		memset(arr,-1,sizeof(arr));
		set<int>st[n];
		m=-1;
		for(int i=1;i<=n;i++)
		{
			//cout<<i<<" "<<prime[i]<<endl;
			if(prime[i]==i)
			{
				if(arr[i]==-1)
				{
					arr[i]=++m;
					//cout<<m<<endl;
				}
				for(int j=1;j<=(n/i);j++)
				{
					arr[j]=arr[i];
					st[arr[i]].insert(i*j);
				}
			}
		}
		//cout<<m<<endl;
		//cout<<st[0].size()<<endl;
		for(int i=0;i<n;i++)
		{
			freq[s[i]-96]++;
		}
		for(int i=0;i<=m;i++)
		{
			l=0;
			flag=0;
			pos=-1;
			for(int j=1;j<=26;j++)
			{
				if(freq[j]==st[i].size())
				{
					for(auto k:st[i])
					{
						//cout<<i<<" "<<k<<endl;
						ans[k-1]=char(j+96);
					}
					//cout<<ans[4]<<endl;
					freq[j]=0;
					//cout<<j<<endl;
					flag=1;
					pos=-1;
					break;
				}
				else if(freq[j]>st[i].size() && freq[j]>l)
				{
					pos=j;
					//ch=char(j+96);
					l=freq[j];
					flag=1;
				}
			}
			if(flag==0)
				break;
			else if(pos!=-1)
			{
				for(auto k:st[i])
				{
					ans[k-1]=char(pos+96);
					//
				}
				//cout<<pos<<endl;
				freq[pos]-=st[i].size();
			}
		}
		if(flag==0)
			cout<<"NO"<<endl;
		else
		{
			//cout<<freq[25]<<endl;
			cout<<"YES"<<endl;
			for(int i=1;i<=26;i++)
			{
				//cout<<freq[25]<<endl;
				if(freq[i]>0)
				{
					ans[0]=char(i+96);
					break;
				}
			}
			for(int i=0;i<n;i++)
				cout<<ans[i];
			cout<<endl;
		}
	}
	return 0;
}


// God put a smile upon your face <3

#include <bits/stdc++.h>

#define slld(longvalue) scanf("%lld", &longvalue)

#define ll long long
#define ull unsigned long long
#define pll pair < long long, long long >

#define fastio ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0)

#define pb push_back

#define bug printf("BUG\n")

#define mxlld LLONG_MAX
#define mnlld -LLONG_MAX

#define mxd 2e8
#define mnd -2e8

#define pi 3.14159265359

using namespace std;

bool check(ll n, ll pos)
{
	return n & (1LL << pos);
}

ll Set(ll n, ll pos)
{
	return n = n | (1LL << pos);
}

ll freq[30];
map < ll, ll > mp;

const ll maxn  = 2000;
vector < ll > primes;
bool vis[maxn+10];

void sieve()
{
    vis[0] = 1;
    vis[1] = 1;

    for(ll i = 4; i <= maxn; i += 2)
    {
        vis[i] = 1;
    }

    for(ll i = 3; i * i <= maxn; i += 2)
    {
        if(vis[i] == 0)
        for(ll j = i * i; j <= maxn; j += i)
        {
            vis[j] = 1;
        }
    }

    for(ll i = 2; i <= maxn; i++)
    {
        if(vis[i] == false)
        primes.pb(i);
    }

}

string s, t;
priority_queue < pll > pq;

bool col(ll num, ll c, ll sz)
{
//	cout << num << " " << (mp.find(num) != mp.end()) << endl;
	if(mp.find(num) != mp.end())
	{
		if(mp[num] != c) return 0;
		return 1;
	}

	mp[num] = c;

	bool ret = 1;

	for(ll i = num; i <= sz; i += num)
	{
		if(s[i] != '*')
		{
			if(s[i] != c + 'a') return 0;
			continue;
		}

		s[i] = c + 'a';
		freq[c]--;

		if(freq[c] < 0) return 0;

		ll tmp = i;

		for(auto it: primes)
		{
			if(it > tmp) break;

			if(tmp % it == 0)
			{
				ret &= col(it, c, sz);

				while(tmp % it == 0) tmp /= it;
			}
		}

		if(tmp > 1) ret &= col(tmp, c, sz);
	}

	return ret;
}
bool solve()
{
	mp.clear();
	memset(freq,0,sizeof freq);

	while(!pq.empty())
	{
		pq.pop();
	}

	for(auto it: s) freq[it - 'a']++;

	for(ll i = 0; i < 26; i++)
	{
		pq.push({freq[i],i});
	}

	ll sz = s.size();

	s = "";

	for(ll i = 0; i <= sz; i++) s += '*';

	for(auto it: primes)
	{
		if(it > sz) break;

		if(mp.find(it) != mp.end()) continue;

		pll top = pq.top();
		pq.pop();

		if(col(it,top.second,sz) == 0) return 0;

		pq.push({freq[top.second], top.second});
	}

	t = "";

	for(ll i = 1; i <= sz; i++)
	{
		if(s[i] != '*') continue;

		pll top = pq.top();
		pq.pop();

//		cout << top.first << " " << top.second << endl;

		s[i] = top.second + 'a';
		top.first--;

		if(top.first < 0) return 0;

		pq.push(top);
	}

	for(ll i = 1; i <= sz; i++) t += s[i];

	return 1;
}

int main()
{
    ll i, j, k, l, m, n, o, r, q;
    ll testcase;
    ll input, flag, tag, ans;

//    freopen("input.txt", "r", stdin);

//    freopen("output.txt", "w", stdout);

	sieve();

    while(cin >> s)
    {
		if(solve())
		{
			printf("YES\n");
			cout << t << "\n";
		}
		else printf("NO\n");
    }

}


// God put a smile upon your face <3

#include <bits/stdc++.h>

#define slld(longvalue) scanf("%lld", &longvalue)

#define ll long long
#define ull unsigned long long
#define pll pair < long long, long long >

#define fastio ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0)

#define pb push_back

#define bug printf("BUG\n")

#define mxlld LLONG_MAX
#define mnlld -LLONG_MAX

#define mxd 2e8
#define mnd -2e8

#define pi 3.14159265359

using namespace std;

bool check(ll n, ll pos)
{
	return n & (1LL << pos);
}

ll Set(ll n, ll pos)
{
	return n = n | (1LL << pos);
}

ll freq[30];
map < ll, ll > mp;

const ll maxn  = 2000;
vector < ll > primes;
bool vis[maxn+10];

void sieve()
{
    vis[0] = 1;
    vis[1] = 1;

    for(ll i = 4; i <= maxn; i += 2)
    {
        vis[i] = 1;
    }

    for(ll i = 3; i * i <= maxn; i += 2)
    {
        if(vis[i] == 0)
        for(ll j = i * i; j <= maxn; j += i)
        {
            vis[j] = 1;
        }
    }

    for(ll i = 2; i <= maxn; i++)
    {
        if(vis[i] == false)
        primes.pb(i);
    }

}

string s, t;
priority_queue < pll > pq;

bool col(ll num, ll c, ll sz)
{
	if(mp[num])
	{
		if(mp[num] != c) return 0;
		return 1;
	}

	mp[num] = c;

	bool ret = 1;

	for(ll i = num; i <= sz; i += num)
	{
		if(s[i] != '*')
		{
			if(s[i] != c + 'a') return 0;
			continue;
		}

		s[i] = c + 'a';
		freq[c]--;

		if(freq[c] < 0) return 0;

		ll tmp = i;

		for(auto it: primes)
		{
			if(it > tmp) break;

			if(tmp % it == 0)
			{
				ret &= col(it, c, sz);

				while(tmp % it == 0) tmp /= it;
			}
		}

		if(tmp > 1) ret &= col(tmp, c, sz);
	}

	return ret;
}
bool solve()
{
	mp.clear();
	memset(freq,0,sizeof freq);

	while(!pq.empty())
	{
		pq.pop();
	}

	for(auto it: s) freq[it - 'a']++;

	for(ll i = 0; i < 26; i++)
	{
		pq.push({freq[i],i});
	}

	ll sz = s.size();

	s = "";

	for(ll i = 0; i <= sz; i++) s += '*';

	for(auto it: primes)
	{
		if(it > sz) break;

		if(mp[it]) continue;

		pll top = pq.top();
		pq.pop();

		if(col(it,top.second,sz) == 0) return 0;

		pq.push({freq[top.second], top.second});
	}

	t = "";

//	cout << s << endl;

	for(ll i = 1; i <= sz; i++)
	{
		if(s[i] != '*') continue;

		pll top = pq.top();
		pq.pop();

//		cout << top.first << " " << top.second << endl;

		s[i] = top.second + 'a';
		top.first--;

		if(top.first < 0) return 0;

		pq.push(top);
	}

	for(ll i = 1; i <= sz; i++) t += s[i];

	return 1;
}

int main()
{
    ll i, j, k, l, m, n, o, r, q;
    ll testcase;
    ll input, flag, tag, ans;

//    freopen("input.txt", "r", stdin);

//    freopen("output.txt", "w", stdout);

	sieve();

    while(cin >> s)
    {
		if(solve())
		{
			printf("YES\n");
			cout << t << "\n";
		}
		else printf("NO\n");
    }

}


// God put a smile upon your face <3

#include <bits/stdc++.h>

#define slld(longvalue) scanf("%lld", &longvalue)

#define ll long long
#define ull unsigned long long
#define pll pair < long long, long long >

#define fastio ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0)

#define pb push_back

#define bug printf("BUG\n")

#define mxlld LLONG_MAX
#define mnlld -LLONG_MAX

#define mxd 2e8
#define mnd -2e8

#define pi 3.14159265359

using namespace std;

bool check(ll n, ll pos)
{
	return n & (1LL << pos);
}

ll Set(ll n, ll pos)
{
	return n = n | (1LL << pos);
}

ll freq[30];
map < ll, ll > mp;

const ll maxn  = 2000;
vector < ll > primes;
bool vis[maxn+10];

void sieve()
{
    vis[0] = 1;
    vis[1] = 1;

    for(ll i = 4; i <= maxn; i += 2)
    {
        vis[i] = 1;
    }

    for(ll i = 3; i * i <= maxn; i += 2)
    {
        if(vis[i] == 0)
        for(ll j = i * i; j <= maxn; j += i)
        {
            vis[j] = 1;
        }
    }

    for(ll i = 2; i <= maxn; i++)
    {
        if(vis[i] == false)
        primes.pb(i);
    }

}

string s, t;
priority_queue < pll > pq;

bool col(ll num, ll c, ll sz)
{
	if(mp[num])
	{
		if(mp[num] != c) return 0;
		return 1;
	}

	mp[num] = c;

	bool ret = 1;

	for(ll i = num; i <= sz; i += num)
	{
		if(s[i] != '*')
		{
			if(s[i] != c + 'a') return 0;
			continue;
		}

		s[i] = c + 'a';
		freq[c]--;

		if(freq[c] < 0) return 0;

		ll tmp = i;

		for(auto it: primes)
		{
			if(it > tmp) break;

			if(tmp % it == 0)
			{
				ret &= col(it, c, sz);

				while(tmp % it == 0) tmp /= it;
			}
		}

		if(tmp > 1) ret &= col(tmp, c, sz);
	}

	return ret;
}
bool solve()
{
	mp.clear();
	memset(freq,0,sizeof freq);

	while(!pq.empty())
	{
		pq.pop();
	}

	for(auto it: s) freq[it - 'a']++;

	for(ll i = 0; i < 25; i++)
	{
		pq.push({freq[i],i});
	}

	ll sz = s.size();

	s = "";

	for(ll i = 0; i <= sz; i++) s += '*';

	for(auto it: primes)
	{
		if(it > sz) break;

		if(mp[it]) continue;

		pll top = pq.top();
		pq.pop();

		if(col(it,top.second,sz) == 0) return 0;

		pq.push({freq[top.second], top.second});
	}

	t = "";

	for(ll i = 1; i <= sz; i++)
	{
		if(s[i] != '*') continue;

		pll top = pq.top();
		pq.pop();

		s[i] = top.second + 'a';
		top.first--;

		if(top.first < 0) return 0;

		pq.push(top);
	}

	for(ll i = 1; i <= sz; i++) t += s[i];

	return 1;
}

int main()
{
    ll i, j, k, l, m, n, o, r, q;
    ll testcase;
    ll input, flag, tag, ans;

//    freopen("input.txt", "r", stdin);

//    freopen("output.txt", "w", stdout);

	sieve();

    while(cin >> s)
    {
		if(solve())
		{
			printf("YES\n");
			cout << t << "\n";
		}
		else printf("NO\n");
    }

}


//Bismillah

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef double dl;

#define PB push_back
#define F first
#define S second
#define MP make_pair
#define endl '\n'
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mid(l,r) ((r+l)/2)
#define left(node) (node*2)
#define right(node) (node*2+1)
#define mx_int_prime 999999937

const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define sqr(a) ((a) * (a))

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}

int ans[26];
int main()
{
    optimize();
    char st[1001];
    scanf("%s",st+1);
    int l=strlen(st+1);
    int mx=0;
    char ch;
    for(int i=1;i<=l;i++){
        int k=st[i]-'a';
        if((++ans[k])>mx) mx=ans[k],ch=st[i];
    }

    if(mx>=(l/2)) cout<<"YES"<<endl;
    else return cout<<"NO"<<endl , 0;
    queue<char>q;
    for(int i=1;i<=l;i++){
        if((i&1)!=1){
            if(st[i]!=ch){
                q.push(st[i]);
                st[i]=ch;
            }
        }
    }
    for(int i=1;i<=l;i++){
        if(i&1){
            if(st[i]==ch){
                if(!q.empty()){
                    char c=q.front();
                    q.pop();
                    st[i]=c;
                }else break;
            }
        }
    }

    for(int i=1;i<=l;i++) cout<<st[i];
    return 0;
}