#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <memory.h>
#include <cmath>
#include <string>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define FOR(i,a,b) for ((i) = (a); i < (b); ++i)
#define inf 1000000000

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

vector <int> Q;
vector <int> Y;
int n,i,j;
string s;
vector <int> pr;
int R[30];

int A[2000] = {0};

int main()
{
     cin >> s;
     int k;
     n = s.size();
     FOR(i,0,n)
      A[i] = -1;
     FOR(i,2,n+1)
      if (prost(i)) pr.pb(i);

     memset(R,0,sizeof(R));

     FOR(i,0,s.size())
       ++R[s[i]-'a'];

            FOR(i,0,26)
              if (R[i])
               {
                Q.pb(R[i]);
                Y.pb(i);
               }

            FOR(i,0,Q.size())
             FOR(j,i+1,Q.size())
              if (Q[i] < Q[j])
               {
                k = Q[i]; Q[i] = Q[j]; Q[j] = k;
                k = Y[i]; Y[i] = Y[j]; Y[j] = k;
               }

            FOR(i,0,n)
             {
               j = i + 1;
               if (j%2 == 0)
                {
                 A[i] = Y[0];
                 if (Q[0] == 0)
                  {
                     cout << "NO" << endl;
                     exit(0);
                  }
                 else --Q[0];

                 if (j/2 != 1 && A[j/2-1] == -1)
                  {
                   if (Q[0] == 0)
                    {
                     cout <<"NO" << endl;
                     exit(0);
                    }
                   else --Q[0];
                   A[j/2-1] = Y[0];
                  }

                }
             }
            FOR(i,0,n)
             if (A[i] == -1)
               {
                FOR(j,0,Q.size())
                  if (Q[j])
                   {
                    Q[j]--;
                    A[i] = Y[j];
                    break;
                   }
               }

            cout << "YES" << endl;
            FOR(i,0,n)
              cout << (char)('a' + A[i]);
            cout << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <memory.h>
#include <cmath>
#include <string>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define FOR(i,a,b) for ((i) = (a); i < (b); ++i)
#define inf 1000000000

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

     }
 }

vector <int> Q;
vector <int> Y;
int n,i,j;
string s;
vector <int> pr;
int R[30];

int A[2000] = {0};

int main()
{
     cin >> s;
     int k;
     n = s.size();
     FOR(i,0,n)
      A[i] = -1;
     FOR(i,2,n+1)
      if (prost(i)) pr.pb(i);

     memset(R,0,sizeof(R));

     FOR(i,0,s.size())
       ++R[s[i]-'a'];

     if (s.size() < 4) {
                        cout << "YES" << endl;
                        cout << s << endl;
                        exit(0);
                       }
          else
           {
            FOR(i,0,26)
              if (R[i])
               {
                Q.pb(R[i]);
                Y.pb(i);
               }

            FOR(i,0,Q.size())
             FOR(j,i+1,Q.size())
              if (Q[i] < Q[j])
               {
                k = Q[i]; Q[i] = Q[j]; Q[j] = k;
                k = Y[i]; Y[i] = Y[j]; Y[j] = k;
               }

            FOR(i,0,n)
             {
               j = i + 1;
               if (j%2 == 0)
                {
                 A[i] = Y[0];
                 if (Q[0] == 0)
                  {
                     cout << "NO" << endl;
                     exit(0);
                  }
                 else --Q[0];

                 if (i != 1 && A[i/2] == -1)
                  {
                   if (Q[0] == 0)
                    {
                     cout <<"NO" << endl;
                     exit(0);
                    }
                   else --Q[0];
                   A[i/2] = Y[0];
                  }

                }
             }
            FOR(i,0,n)
             if (A[i] == -1)
               {
                FOR(j,0,Q.size())
                  if (Q[j])
                   {
                    Q[j]--;
                    A[i] = Y[j];
                    break;
                   }
               }

            cout << "YES" << endl;
            FOR(i,0,n)
              cout << (char)('a' + A[i]);
            cout << endl;
           }
}


/*****************************************************************************
 *************************** Macros and Typedefs *****************************
 *****************************************************************************/

// #pragma stacksize 1M twice
// #pragma comment(linked, "/STACK:16777216")

#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <time.h>
#include <vector>

using namespace std;

#define mp make_pair
#define pb push_back
#define fi(n) fo(i,n)
#define fj(n) fo(j,n)
#define fk(n) fo(k,n)
#define fd(i,n) for(int i=(int)(n)-1; i>=0; --i)
#define fo(i,n) fr(i,0,n)
#define fr(i,a,b) for(int i=(int)a; i<(int)b; ++i)
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define sqr(x) ((x) * (x))
#define srt(x) sort(all(x))
#define go(x,it) for(typeof((x).begin()) it=(x).begin(); it!=(x).end(); ++it)
#define PQ(t) priority_queue< t, vector<t>, greater<t> >
#define x first
#define y second
#define me (*this)
#define CLR(a,v) memset(a, v, sizeof(a))

typedef long long ll;
typedef long double ld;

typedef pair< int,int > ii;
typedef vector< ii > vii;
typedef vector< vii > vvii;

typedef vector< int > vi;
typedef vector< vi > vvi;

typedef vector< double > vd;
typedef vector< vd > vvd;

typedef vector< ll > vll;
typedef vector< vll > vvll;

typedef vector< string > vs;

/*****************************************************************************
 ****************************** My Methods ***********************************
 *****************************************************************************/

// my stuff
const int INF = 1000*1000*1000+7;
const double EPS = 1e-9;
int bit_count(int x){ return x==0 ? 0 : 1+bit_count(x&(x-1)); }
inline int low_bit(int x){ return x&-x; } // 0011 0100 return 0000 0100
inline int sign(double x){ return x<-EPS ? -1 : x>EPS ? 1 : 0; }
inline int sign(int x){ return (x>0)-(x<0); }

/*****************************************************************************
 **************************** Scanner Methods ********************************
 *****************************************************************************/

inline int getInt(){
    int a;
    return scanf("%d", &a) ? a : (fprintf(stderr, "trying to read\n"),-1);
}

inline double getDouble(){
    double a;
    return scanf("%lf", &a) ? a : (fprintf(stderr, "trying to read\n"),-1.0);
}

inline double myRand(){
    return ((double)rand()/RAND_MAX) + ((double)rand()/RAND_MAX/RAND_MAX);
}

/*
 *  // does not get the new line
 *  getline(cin, s);
 *
 *  srt(a); a.resize(unique(all(a))-a.begin());
 *
 *  // remember, only do this for 0 and -1, INF etc may not work
 *  memset(dp, 0, sizeof(dp));
 *
 *  struct comp_1{
 *      bool operator()(const ii &a, const ii &b) const{
 *          return a.x!=b.x ? a.x<b.x : a.y<b.y;
 *      }
 *  };
 *
 *  sprintf(buf, "%s%d%s%d%s\n", "Hell", 0, " W", 0, "rld!");
 *
 *  (map<int,int>::iterator it = cache.begin(); it!=cache.end(); ++it)
 */

const int BUF_SIZE = 1001*1000;
char buf[BUF_SIZE];

inline string getToken(){
    return scanf("%s", buf) ? buf : (fprintf(stderr, "trying to read\n"),"");
}

// does not return the new line
inline string getLine(){
    string ret;
    getline(cin, ret);
    // getline(cin, ret, ':'); // to use ':' as the delimiter
    return ret;
}

/*****************************************************************************
 ************************* Problem Specific Code *****************************
 *****************************************************************************/

// END_CUT

const int MAX = 1010;

struct UnionFind{
  int n; vi p, r;
  UnionFind(int nn): n(nn){
    p = vi(n); fi(n) p[i] = i;
    r = vi(n,1);
  }
  int findp (int x) {
    if(p[x] != x) p[x] = findp(p[x]);
    return p[x];
  }
  int merge(int a, int b){
    int pa=findp(a), pb=findp(b);
    if(pa==pb) return 0;
    if(r[pa] < r[pb]){ p[pa] = pb; }
    else{ p[pb] = pa; ++r[pa]; }
    return 1;
  }
};

void myCode(){
  string s = getToken(); int n = sz(s);
  fprintf(stderr,"%d\n",n);
  vii numchars = vii(26); fi(26) numchars[i] = ii(0,i);
  go(s,i) numchars[*i-'a'].x++;
  ii big = *(max_element(all(numchars)));

  int prime[MAX]; fi(MAX) prime[i] = 1; prime[0] = prime[1] = 0;
  fr(i,2,MAX) if (prime[i]) fr(j,i,MAX/i+1) prime[i*j] = 0;
  int classes[MAX];
  classes[0] = 0;
  fr(i,1,n/2) classes[i] = 1;
  fr(i,n/2,n) classes[i] = prime[i+1] ? 0 : 1;
  int mybig = 0; fi(n) if (classes[i]) mybig++;
  fprintf(stderr,"big.x = %d, big.y = %d, mybig = %d\n",big.x,big.y,mybig);

  if (big.x < mybig) printf("NO\n");
  else {
    printf("YES\n");
    fi(n) fprintf(stderr,"%d",classes[i]); fprintf(stderr,"\n");
    string t(s);
    int i = 0, j = 0;
    while (i < mybig) {
      if (t[j]-'a' == big.y) {
        i++; t.erase(j+t.begin());
      }
      else j++;
    }
    fprintf(stderr,"t is %s\n",t.c_str());

    j = 0;
    fi(n) {
      if (!classes[i]) { printf("%c",t[j]); j++; }
      else printf("%c",big.y+'a');
    }
    printf("\n");
  }

//  UnionFind arr(n);
//  fr(i,2,MAX) for(int j = 2*i; j < MAX; j+=i) arr.merge(i-1,j-1);
//  vi usize = vi(n,0);
//  go(arr.p,i) usize[*i]++;
//  if (max_element(all(usize)) == max_element(
}

int main() {
    srand(time(NULL));
    myCode();
    return 0;
}


/*****************************************************************************
 *************************** Macros and Typedefs *****************************
 *****************************************************************************/

// #pragma stacksize 1M twice
// #pragma comment(linked, "/STACK:16777216")

#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <time.h>
#include <vector>

using namespace std;

#define mp make_pair
#define pb push_back
#define fi(n) fo(i,n)
#define fj(n) fo(j,n)
#define fk(n) fo(k,n)
#define fd(i,n) for(int i=(int)(n)-1; i>=0; --i)
#define fo(i,n) fr(i,0,n)
#define fr(i,a,b) for(int i=(int)a; i<(int)b; ++i)
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define sqr(x) ((x) * (x))
#define srt(x) sort(all(x))
#define go(x,it) for(typeof((x).begin()) it=(x).begin(); it!=(x).end(); ++it)
#define PQ(t) priority_queue< t, vector<t>, greater<t> >
#define x first
#define y second
#define me (*this)
#define CLR(a,v) memset(a, v, sizeof(a))

typedef long long ll;
typedef long double ld;

typedef pair< int,int > ii;
typedef vector< ii > vii;
typedef vector< vii > vvii;

typedef vector< int > vi;
typedef vector< vi > vvi;

typedef vector< double > vd;
typedef vector< vd > vvd;

typedef vector< ll > vll;
typedef vector< vll > vvll;

typedef vector< string > vs;

/*****************************************************************************
 ****************************** My Methods ***********************************
 *****************************************************************************/

// my stuff
const int INF = 1000*1000*1000+7;
const double EPS = 1e-9;
int bit_count(int x){ return x==0 ? 0 : 1+bit_count(x&(x-1)); }
inline int low_bit(int x){ return x&-x; } // 0011 0100 return 0000 0100
inline int sign(double x){ return x<-EPS ? -1 : x>EPS ? 1 : 0; }
inline int sign(int x){ return (x>0)-(x<0); }

/*****************************************************************************
 **************************** Scanner Methods ********************************
 *****************************************************************************/

inline int getInt(){
    int a;
    return scanf("%d", &a) ? a : (fprintf(stderr, "trying to read\n"),-1);
}

inline double getDouble(){
    double a;
    return scanf("%lf", &a) ? a : (fprintf(stderr, "trying to read\n"),-1.0);
}

inline double myRand(){
    return ((double)rand()/RAND_MAX) + ((double)rand()/RAND_MAX/RAND_MAX);
}

/*
 *  // does not get the new line
 *  getline(cin, s);
 *
 *  srt(a); a.resize(unique(all(a))-a.begin());
 *
 *  // remember, only do this for 0 and -1, INF etc may not work
 *  memset(dp, 0, sizeof(dp));
 *
 *  struct comp_1{
 *      bool operator()(const ii &a, const ii &b) const{
 *          return a.x!=b.x ? a.x<b.x : a.y<b.y;
 *      }
 *  };
 *
 *  sprintf(buf, "%s%d%s%d%s\n", "Hell", 0, " W", 0, "rld!");
 *
 *  (map<int,int>::iterator it = cache.begin(); it!=cache.end(); ++it)
 */

const int BUF_SIZE = 1001*1000;
char buf[BUF_SIZE];

inline string getToken(){
    return scanf("%s", buf) ? buf : (fprintf(stderr, "trying to read\n"),"");
}

// does not return the new line
inline string getLine(){
    string ret;
    getline(cin, ret);
    // getline(cin, ret, ':'); // to use ':' as the delimiter
    return ret;
}

/*****************************************************************************
 ************************* Problem Specific Code *****************************
 *****************************************************************************/

// END_CUT

const int MAX = 1010;

struct UnionFind{
  int n; vi p, r;
  UnionFind(int nn): n(nn){
    p = vi(n); fi(n) p[i] = i;
    r = vi(n,1);
  }
  int findp (int x) {
    if(p[x] != x) p[x] = findp(p[x]);
    return p[x];
  }
  int merge(int a, int b){
    int pa=findp(a), pb=findp(b);
    if(pa==pb) return 0;
    if(r[pa] < r[pb]){ p[pa] = pb; }
    else{ p[pb] = pa; ++r[pa]; }
    return 1;
  }
};

void myCode(){
  string s = getToken(); int n = sz(s);
  vii numchars = vii(26); fi(26) numchars[i] = ii(0,i);
  go(s,i) numchars[*i-'a'].x++;
  ii big = *(max_element(all(numchars)));

  int prime[MAX]; fi(MAX) prime[i] = 1; prime[0] = prime[1] = 0;
  fr(i,2,MAX) if (prime[i]) fr(j,i,MAX/i+1) prime[i*j] = 0;
  int classes[MAX];
  classes[0] = 0;
  fr(i,1,ceil(n/2.0)) classes[i] = 1;
  fr(i,ceil(n/2.0),n) classes[i] = prime[i+1] ? 0 : 1;
  int mybig = 0; fi(n) if (classes[i]) mybig++;
  fprintf(stderr,"big.x = %d, big.y = %d, mybig = %d\n",big.x,big.y,mybig);

  if (big.x < mybig) printf("NO\n");
  else {
    printf("YES\n");
    fi(n) fprintf(stderr,"%d",classes[i]); fprintf(stderr,"\n");
    string t(s);
    int i = 0, j = 0;
    while (i < mybig) {
      if (t[j]-'a' == big.y) {
        i++; t.erase(j+t.begin());
      }
      else j++;
    }
    fprintf(stderr,"t is %s\n",t.c_str());

    j = 0;
    fi(n) {
      if (!classes[i]) { printf("%c",t[j]); j++; }
      else printf("%c",big.y+'a');
    }
    printf("\n");
  }

//  UnionFind arr(n);
//  fr(i,2,MAX) for(int j = 2*i; j < MAX; j+=i) arr.merge(i-1,j-1);
//  vi usize = vi(n,0);
//  go(arr.p,i) usize[*i]++;
//  if (max_element(all(usize)) == max_element(
}

int main() {
    srand(time(NULL));
    myCode();
    return 0;
}


/*****************************************************************************
 *************************** Macros and Typedefs *****************************
 *****************************************************************************/

// #pragma stacksize 1M twice
// #pragma comment(linked, "/STACK:16777216")

#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <time.h>
#include <vector>

using namespace std;

#define mp make_pair
#define pb push_back
#define fi(n) fo(i,n)
#define fj(n) fo(j,n)
#define fk(n) fo(k,n)
#define fd(i,n) for(int i=(int)(n)-1; i>=0; --i)
#define fo(i,n) fr(i,0,n)
#define fr(i,a,b) for(int i=(int)a; i<(int)b; ++i)
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define sqr(x) ((x) * (x))
#define srt(x) sort(all(x))
#define go(x,it) for(typeof((x).begin()) it=(x).begin(); it!=(x).end(); ++it)
#define PQ(t) priority_queue< t, vector<t>, greater<t> >
#define x first
#define y second
#define me (*this)
#define CLR(a,v) memset(a, v, sizeof(a))

typedef long long ll;
typedef long double ld;

typedef pair< int,int > ii;
typedef vector< ii > vii;
typedef vector< vii > vvii;

typedef vector< int > vi;
typedef vector< vi > vvi;

typedef vector< double > vd;
typedef vector< vd > vvd;

typedef vector< ll > vll;
typedef vector< vll > vvll;

typedef vector< string > vs;

/*****************************************************************************
 ****************************** My Methods ***********************************
 *****************************************************************************/

// my stuff
const int INF = 1000*1000*1000+7;
const double EPS = 1e-9;
int bit_count(int x){ return x==0 ? 0 : 1+bit_count(x&(x-1)); }
inline int low_bit(int x){ return x&-x; } // 0011 0100 return 0000 0100
inline int sign(double x){ return x<-EPS ? -1 : x>EPS ? 1 : 0; }
inline int sign(int x){ return (x>0)-(x<0); }

/*****************************************************************************
 **************************** Scanner Methods ********************************
 *****************************************************************************/

inline int getInt(){
    int a;
    return scanf("%d", &a) ? a : (fprintf(stderr, "trying to read\n"),-1);
}

inline double getDouble(){
    double a;
    return scanf("%lf", &a) ? a : (fprintf(stderr, "trying to read\n"),-1.0);
}

inline double myRand(){
    return ((double)rand()/RAND_MAX) + ((double)rand()/RAND_MAX/RAND_MAX);
}

/*
 *  // does not get the new line
 *  getline(cin, s);
 *
 *  srt(a); a.resize(unique(all(a))-a.begin());
 *
 *  // remember, only do this for 0 and -1, INF etc may not work
 *  memset(dp, 0, sizeof(dp));
 *
 *  struct comp_1{
 *      bool operator()(const ii &a, const ii &b) const{
 *          return a.x!=b.x ? a.x<b.x : a.y<b.y;
 *      }
 *  };
 *
 *  sprintf(buf, "%s%d%s%d%s\n", "Hell", 0, " W", 0, "rld!");
 *
 *  (map<int,int>::iterator it = cache.begin(); it!=cache.end(); ++it)
 */

const int BUF_SIZE = 1001*1000;
char buf[BUF_SIZE];

inline string getToken(){
    return scanf("%s", buf) ? buf : (fprintf(stderr, "trying to read\n"),"");
}

// does not return the new line
inline string getLine(){
    string ret;
    getline(cin, ret);
    // getline(cin, ret, ':'); // to use ':' as the delimiter
    return ret;
}

/*****************************************************************************
 ************************* Problem Specific Code *****************************
 *****************************************************************************/

// END_CUT

void myCode(){
  string s = getToken();
  int n = sz(s), nPrimes = 1; // 1 is prime for my purposes
  fr(i,2,n+1){
    int prime = 1;
    fr(j,2,i) if(i%j==0)
      prime = 0;
    if(i<n/2+1)
      prime = 0; // <= n/2 is not prime for my purposes
    if(prime) ++nPrimes;
  }

  int nKill = n - nPrimes;

  vii ch(26); fi(26) ch[i] = ii(0,i);
  go(s,i) ++ch[*i-'a'].x;
  srt(ch); reverse(all(ch));

  if(ch[0].x < nKill){
    printf("NO\n");
  }else{
    printf("YES\n");

    fi(n) if(nKill){
      if(s[i] == ch[0].y+'a'){
        --nKill;
        s[i] = '*';
      }
    }

    int k;
    for(k=0; s[k]=='*'; ++k);
      printf("%c", s[k++]);
    fr(i,2,n+1){
      int prime = 1;
      fr(j,2,i) if(i%j==0)
        prime = 0;
      if(i<n/2+1)
        prime = 0;
      if(prime){
        while(s[k]=='*') ++k;
        printf("%c", s[k++]);
      }else{
        printf("%c", ch[0].y+'a');
      }
    }

    printf("\n");

  }

}

int main() {
    srand(time(NULL));
    myCode();
    return 0;
}


#include <bits/stdc++.h>
using namespace std ;
#define mod 1000000007
char s[1055];
bool v[1005];
int prim[305],cnt;
bool init(int n)
{
    memset(v,0,sizeof(v));
    int i,j;
    for(i=2;i<=n;++i)
    {
        if(!v[i])
            prim[cnt++]=i;
        for(j=0;j<cnt && i*prim[j]<=n;++j)
        {
            v[i*prim[j]]=1;
            if(i%prim[j]==0)
                break;
        }
    }
}
int main()
{
    int i,j;
    scanf("%s",s+1);
    int l=strlen(s+1);
    bool flag=0;
    init(l);
    do
    {
        for(i=0;i<cnt&&!flag;++i)
        {
            char c=s[prim[i]];
            for(j=1;j<=l/prim[i]; ++j)
            {
                if(s[prim[i]*j]!=c)
                {
                    break;
                }
            }
            if(j>l/prim[i])
            {
                continue;
            }
            else
            {
                break;
            }
        }
        if(i>=cnt) flag=1;
    }
    while(!flag&&next_permutation(s+1,s+1+l));
    if(flag)
    {
        puts("YES");
        puts(s+1);
    }
    else
    {
        puts("NO");
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std ;
long long int count1[26] ;
std::vector<long long int> v;
void prime(long long int n)
{
    for(long long int i=2;i<=n;i++)
    {
        for(long long int j=2;j*j<=i;j++)
        {
            if(j%i==0)
                break ;
        }
        v.push_back(i) ;
    }
    return ;
}

long long int min(long long int a,long long int b)
{
    if(a<b)
        return a ;
    return b ;
}

int main()
{
    long long int max_count1 = 100000000 ;
    string s ;
    cin >> s ;
    prime(s.length()) ;
    for(long long int i=0;i<v.size();i++)
    {
        max_count1 = min(max_count1,(s.length())/(v[i])) ;
    }
    for(long long int i=0;i<s.length();i++)
    {
        count1[s[i]-'a']++ ;
    }
    sort(count1,count1+26) ;
    long long int max1 = count1[25] ;
    if(max1>=max_count1)
    {
        cout << "YES" ;
    }
    else
    {
        cout << "NO" ;
    }
    //cout << max1 << "\n" ;
    /*for(long long int i=0;i<26;i++)
    {
        cout << count1[i] << " " ;
    }*/
    //cout << "\n" ;

    return 0 ;
}


#include <bits/stdc++.h>
using namespace std ;
char s[1005];
long long int w[26];
long long int d[1005];

int main()
{
    cin >> s ;
    for(long long int i=0;s[i];i++)
    {
        w[s[i]-'a']++;
    }
    long long int n = strlen(s),c=n-1;
    d[0] = 1;
    for(long long int i=n/2+1;i<=n;i++)
    {
        for(long long int j=2;j<=i;j++)
        {
            if(i%j==0)
            {
                if(i==j)
                {
                    d[i-1]=1;
                    --c;
                }
                break;
            }
        }
    }
    if(*max_element(w,w+26)>=c)
    {
        cout << "YES\n" ;
        char v = max_element(w,w+26)-w +'a';
        for(int i=0;i<n;i++)
        {
            if(d[i]==0)
            {
                s[i]=v;
                w[v-'a']--;
            }
        }
        for(int i=0;i<n;i++)
        {
            if(d[i]==1)
            {
                int j;
                for(j=0;j<26;j++)
                {
                    if(w[j])
                    {
                        break;
                    }
                }
                s[i] = j+'a';
                w[j]--;
            }
        }
        cout << s ;
    }
    else
    {
        cout << "NO" ;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    string s;
    cin >> s;
    int h[30];
    for (int i=0;i<30;++i) h[i]=0;
    for (int i=0;i<s.length();++i) ++h[s[i]-'a'];
    int mc=-1;
    for (int i=0;i<30;++i) {
        if ((mc==-1)||(h[mc]<h[i])) mc=i;
    }
    string b=s;
    for (int i=0;i<b.length();++i) b[i]='?';
    for (int i=2;i<1000;++i) {
        bool pr=true;
        for (int j=2;j*j<=i;++j) {
            if (i%j==0) pr=false;
        }
        if ((pr)&&(i*2<=s.length())) {
            int k=i-1;
            while (k<s.length()) {
                if (b[k]=='?') {
                    if (h[mc]==0) {
                        cout << "NO" << endl;
                        _exit(0);
                    }
                    b[k]=mc+'a';
                    --h[mc];
                }
                k+=i;
            }
        }
    }
    int ps=0;
//    for (int i=0;i<30;++i) cout << h[i] << " " ;
//    cout << endl;
    for (int i=0;i<s.length();++i) {
        if (b[i]=='?') {
            while (h[ps]==0) ++ps;
            --h[ps];
            b[i]=ps+'a';
        }
    }
    cout << "YES" << endl;
    cout << b  << endl;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    string s;
    cin >> s;
    int h[30];
    for (int i=0;i<30;++i) h[i]=0;
    for (int i=0;i<s.length();++i) ++h[s[i]-'a'];
    int mc=-1;
    for (int i=0;i<30;++i) {
        if ((mc==-1)||(h[mc]<h[i])) mc=i;
    }
    string b=s;
    for (int i=0;i<b.length();++i) b[i]='?';
    for (int i=2;i<1000;++i) {
        bool pr=true;
        for (int j=2;j*j<=i;++j) {
            if (i%j==0) pr=false;
        }
        if ((pr)&&(i*2<=s.length())) {
            int k=i-1;
            while (k<s.length()) {
                if (b[k]=='?') {
                    if (h[mc]==0) {
                        cout << "NO" << endl;
                        return 0;
                    }
                    b[k]=mc+'a';
                    --h[mc];
                }
                k+=i;
            }
        }
    }
    int ps=0;
//    for (int i=0;i<30;++i) cout << h[i] << " " ;
//    cout << endl;
    for (int i=0;i<s.length();++i) {
        if (b[i]=='?') {
            while (h[ps]==0) ++ps;
            --h[ps];
            b[i]=ps+'a';
        }
    }
    cout << "YES" << endl;
    cout << b  << endl;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    string s;
    cin >> s;
    int h[30];
    for (int i=0;i<30;++i) h[i]=0;
    for (int i=0;i<s.length();++i) ++h[s[i]-'a'];
    int mc=-1;
    for (int i=0;i<30;++i) {
        if ((mc==-1)||(h[mc]<h[i])) mc=i;
    }
    string b=s;
    for (int i=0;i<b.length();++i) b[i]='?';
    for (int i=2;i<1000;++i) {
        bool pr=true;
        for (int j=2;j*j<=i;++j) {
            if (i%j==0) pr=false;
        }
        if ((pr)&&(i*2<=s.length())) {
            int k=i-1;
            while (k<s.length()) {
                if (b[k]=='?') {
                    if (h[mc]==0) {
                        cout << "NO" << endl;
                        exit(0);
                    }
                    b[k]=mc+'a';
                    --h[mc];
                }
                k+=i;
            }
        }
    }
    int ps=0;
//    for (int i=0;i<30;++i) cout << h[i] << " " ;
//    cout << endl;
    for (int i=0;i<s.length();++i) {
        if (b[i]=='?') {
            while (h[ps]==0) ++ps;
            --h[ps];
            b[i]=ps+'a';
        }
    }
    cout << "YES" << endl;
    cout << b  << endl;
    return 0;
}


#include<cstdio>
#include<cstring>
#include<cmath>

char input[1005],cnt[30];
bool prime[1005];
int max,pos,num;

bool is_prime()
{
    //memset(prime,true,sizeof(prime));
    prime[1]=false;prime[0]=false;
    for(int i=2;i<1005;i++)
    {
        if(prime[i]) continue;
        for(int j=i*2;j<=1000;j++) prime[j]=true;
    }
}
int main()
{
    is_prime();
    while(scanf("%s",input+1)!=EOF)
    {
        memset(cnt,0,sizeof(cnt));
        int len=strlen(input+1);
        for(int i=1;i<=len;i++)
        {
            cnt[input[i]-'a']++;
        }
        max=0;num=0;pos=0;
        for(int i=0;i<26;i++)
        {
            if(cnt[i]>max)
            {max=cnt[i];pos=i;}
        }
        for(int i=2;i<=len;i++)
        {
            if((prime[i])||(i*2<=len)) num++;
        }
        if(max<num)
        {
            printf("NO\n");
            printf("max is %d,num is %d\n",max,num);continue;
        }
        else
        {
            printf("YES\n");
            for(int i=1;i<=len;i++)
            {
                if(((!prime[i])&&(i*2>len))||(i==1))
                {
                    bool flag=false;
                    for(int j=0;j<26;j++)
                    {
                        if(cnt[j]>0&&j!=pos)
                        {
                            printf("%c",j+'a');
                            cnt[j]--;flag=true;
                            break;
                        }
                    }
                    if(!flag) printf("%c",pos+'a');
                }
                else printf("%c",pos+'a');
            }
        }
        printf("\n");
    }
    return 0;
}


#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
using namespace std;

string input;
int cnt[28];
bool search[1005];

void find_num()
{
    search[0]=false;
    search[1]=false;
    for(int i=2;i<=1000;i++)
    {
        if(search[i]) continue;
        for(int j=2*i;j<=1000;j+=i)
        {
            search[j]=true;
        }
    }
}
int main()
{
    find_num();
    while(cin>>input)
    {
        memset(cnt,0,sizeof(cnt));
        int max=0;int fillnum=0;int pos;
        for(int i=0;i<input.size();i++)
        {
            cnt[input[i]-'a']++;
        }
        for(int i=0;i<26;i++)
        {
            if(cnt[i]>max) {max=cnt[i];pos=i;}
        }
        for(int i=0;i<input.size();i++)
        {
            if(search[i+1]||((i+1)*2<=input.size())) fillnum++;
        }
        if(max<fillnum)
        {
            printf("NO\n"); continue;
        }
        printf("YES\n");
        for(int i=0;i<input.size();i++)
        {
            if((!search[i+1])&&((i+1)*2>input.size()))
            {
                bool flag=false;
                for(int j=0;j<26;j++)
                {
                    if(cnt[j]>0&&j!=pos)
                    {
                        printf("%c",j+'a');cnt[j]--;flag=true;break;
                    }
                }
                if(!flag) printf("%c",pos+'a');
            }
            else printf("%c",pos+'a');
        }
        printf("\n");
    }
    return 0;
}


#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
using namespace std;

string input;
int cnt[28];
bool search[1005];

void find_num()
{
    search[0]=false;
    search[1]=false;
    for(int i=2;i<=1000;i++)
    {
        if(search[i]) continue;
        for(int j=2*i;j<=1000;j+=i)
        {
            search[j]=true;
        }
    }
}
int main()
{
    find_num();
    while(cin>>input)
    {
        memset(cnt,0,sizeof(cnt));
        int max=0;int fillnum=0;int pos;
        for(int i=0;i<input.size();i++)
        {
            cnt[input[i]-'a']++;
        }
        for(int i=0;i<26;i++)
        {
            if(cnt[i]>max) {max=cnt[i];pos=i;}
        }
        for(int i=1;i<input.size();i++)
        {
            if(search[i+1]||((i+1)*2<=input.size())) fillnum++;
        }
        if(max<fillnum)
        {
            printf("NO\n"); continue;
        }
        printf("YES\n");
        for(int i=0;i<input.size();i++)
        {
            if(((!search[i+1])&&((i+1)*2>input.size()))||(i+1==1))
            {
                bool flag=false;
                for(int j=0;j<26;j++)
                {
                    if(cnt[j]>0&&j!=pos)
                    {
                        printf("%c",j+'a');cnt[j]--;flag=true;break;
                    }
                }
                if(!flag) printf("%c",pos+'a');
            }
            else printf("%c",pos+'a');
        }
        printf("\n");
    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<cmath>

char input[1005],cnt[30];
bool prime[1005];
int max,pos,num;

bool is_prime()
{
    //memset(prime,true,sizeof(prime));
    prime[1]=false;prime[0]=false;
    for(int i=2;i<1005;i++)
    {
        if(prime[i]) continue;
        for(int j=i*2;j<=1000;j++) prime[j]=true;
    }
}
int main()
{
    is_prime();
    while(scanf("%s",input+1)!=EOF)
    {
        memset(cnt,0,sizeof(cnt));
        int len=strlen(input+1);
        for(int i=1;i<=len;i++)
        {
            cnt[input[i]-'a']++;
        }
        max=0;num=0;pos=0;
        for(int i=0;i<26;i++)
        {
            if(cnt[i]>max)
            {max=cnt[i];pos=i;}
        }
        for(int i=2;i<=len;i++)
        {
            if((prime[i])||(i*2<=len)) num++;
        }
        if(max<num)
        {
            printf("NO\n");
            //printf("max is %d,num is %d\n",max,num);continue;
        }
        else
        {
            printf("YES\n");
            for(int i=1;i<=len;i++)
            {
                if(((!prime[i])&&(i*2>len))||(i==1))
                {
                    bool flag=false;
                    for(int j=0;j<26;j++)
                    {
                        if(cnt[j]>0&&j!=pos)
                        {
                            printf("%c",j+'a');
                            cnt[j]--;flag=true;
                            break;
                        }
                    }
                    if(!flag) printf("%c",pos+'a');
                }
                else printf("%c",pos+'a');
            }
        }
        printf("\n");
    }
    return 0;
}


#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
using namespace std;

string input;
int cnt[28];
bool search[1005];

void find_num()
{
    search[0]=false;
    search[1]=false;
    for(int i=2;i<=1000;i++)
    {
        if(search[i]) continue;
        for(int j=2*i;j<=1000;j+=i)
        {
            search[j]=true;
        }
    }
}
int main()
{
    find_num();
    while(cin>>input)
    {
        memset(cnt,0,sizeof(cnt));
        int max=0;int fillnum=0;int pos;
        for(int i=0;i<input.size();i++)
        {
            cnt[input[i]-'a']++;
        }
        for(int i=0;i<26;i++)
        {
            if(cnt[i]>max) {max=cnt[i];pos=i;}
        }
        for(int i=0;i<input.size();i++)
        {
            if(search[i+1]||((i+1)*2<=input.size())) fillnum++;
        }
        if(max<fillnum)
        {
            printf("NO\n"); continue;
        }
        printf("YES\n");
        for(int i=0;i<input.size();i++)
        {
            if(((!search[i+1])&&((i+1)*2>input.size()))||(i+1==1))
            {
                bool flag=false;
                for(int j=0;j<26;j++)
                {
                    if(cnt[j]>0&&j!=pos)
                    {
                        printf("%c",j+'a');cnt[j]--;flag=true;break;
                    }
                }
                if(!flag) printf("%c",pos+'a');
            }
            else printf("%c",pos+'a');
        }
        printf("\n");
    }
    return 0;
}


#include <cstdio>
#include <vector>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;

const int MAXN = 2010;
const int MAXA = 26;

char s[MAXN];
int tot[MAXA], num[MAXN];
vector< pair<int, int> > arr;
int vis[MAXN];
int n, m;

int gcd(int x, int y) {
  return y == 0 ? x : gcd(y, x%y);
}

void solve()
{
  memset(tot, 0, sizeof(tot));
  for (int i = 0; i < n; ++i) ++tot[s[i]-'a'];

  memset(num, 0, sizeof(num));
  m = 0;
  for (int i = n; i >= 1; --i) {
    for (int j = i+1; j <= n; ++j)
      if (gcd(i, j) > 1) {
	vis[i] = vis[j];
	break;
      }

    if(vis[i] == 0)
      vis[i] = ++m;

    ++num[vis[i]];
  }

  //  for (int i = 1; i <= n; ++i) printf("%d\n", vis[i]);

  arr.clear();
  for (int i = 1; i <= m; ++i) {
    arr.push_back( make_pair(num[i], i) );
  }

  sort(arr.begin(), arr.end());

  for (int i = m-1; i >= 0; --i) {
    int ma = 0, idx = 0;
    for (int j = 0; j < MAXA; ++j)
      if (tot[j] > ma) {
	ma = tot[j];
	idx = j;
      }

    if (ma >= arr[i].first) {
      for (int j = 1; j <= n; ++j)
	if (vis[j] == arr[i].second) s[j-1] = 'a' + idx, --tot[idx];
    } else {
      puts("NO");
      return;
    }
  }

  puts("YES");
  puts(s);
}

int main()
{
  scanf("%s", s);
  n = strlen(s);
  solve();
  return 0;
}


#include <cstdio>
#include <vector>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;

const int MAXN = 1010;
const int MAXA = 26;

char s[MAXN];
int tot[MAXA], num[MAXN];
vector< pair<int, int> > arr;
int vis[MAXN];
int n, m;

int gcd(int x, int y) {
  return y == 0 ? x : gcd(y, x%y);
}

void solve()
{
  for (int i = 0; i < n; ++i) ++tot[s[i]-'a'];

  for (int i = n; i >= 1; --i) {
    for (int j = i+1; j <= n; ++j)
      if (gcd(i, j) > 1) {
	vis[i] = vis[j];
	break;
      }

    if(vis[i] == 0)
      vis[i] = ++m;

    ++num[vis[i]];
  }

  //  for (int i = 1; i <= n; ++i) printf("%d\n", vis[i]);

  arr.clear();
  for (int i = 1; i <= m; ++i) {
    arr.push_back( make_pair(num[i], i) );
  }

  sort(arr.begin(), arr.end());

  for (int i = m; i > 0; --i) {
    int ma = 0, idx = 0;
    for (int j = 0; j < MAXA; ++j)
      if (tot[j] > ma) {
	ma = tot[j];
	idx = j;
      }

    if (ma >= arr[i].first) {
      for (int j = 1; j <= n; ++j)
	if (vis[j] == arr[i].second) s[j-1] = 'a' + idx, --tot[idx];
    } else {
      puts("NO");
      return;
    }
  }

  puts("YES");
  puts(s);
}

int main()
{
  scanf("%s", s);
  n = strlen(s);
  solve();
  return 0;
}


#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;

const int MAXN = 1010;
const int MAXA = 26;

char s[MAXN];
int tot[MAXA], num[MAXN];
int vis[MAXN];
int n, m;

int gcd(int x, int y) {
  return y == 0 ? x : gcd(y, x%y);
}

void solve()
{
  for (int i = 0; i < n; ++i) ++tot[s[i]-'a'];

  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j < i; ++j)
      if (gcd(i, j) > 1) {
	vis[i] = vis[j];
	break;
      }

    if(vis[i] == 0)
      vis[i] = ++m;

    ++num[vis[i]];
  }

  //  for (int i = 1; i <= n; ++i) printf("%d\n", vis[i]);

  int tt = 0;
  memset(s, 0, sizeof(s));
  for (int i = 1; i <= n; ++i)
    if (s[i-1] == 0) {
      for (int j = 0; j < MAXA; ++j)
	if (tot[j] >= num[vis[i]]) {
	  for (int l = i; l <= n; ++l)
	    if (vis[i] == vis[l]) s[l-1] = 'a' + j, ++tt, --tot[j];
	  break;
	}
    }

  if (tt == n) {
    puts("YES");
    puts(s);
  } else
    puts("NO");
}

int main()
{
  scanf("%s", s);
  n = strlen(s);
  solve();
  return 0;
}


#include <cstdio>
#include <vector>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;

const int MAXN = 1010;
const int MAXA = 26;

char s[MAXN];
int tot[MAXA], num[MAXN];
vector< pair<int, int> > arr;
int vis[MAXN];
int n, m;

int gcd(int x, int y) {
  return y == 0 ? x : gcd(y, x%y);
}

void solve()
{
  for (int i = 0; i < n; ++i) ++tot[s[i]-'a'];

  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j < i; ++j)
      if (gcd(i, j) > 1) {
	vis[i] = vis[j];
	break;
      }

    if(vis[i] == 0)
      vis[i] = ++m;

    ++num[vis[i]];
  }

  //  for (int i = 1; i <= n; ++i) printf("%d\n", vis[i]);

  arr.clear();
  for (int i = 1; i <= m; ++i)
    arr.push_back( make_pair(num[i], i) );

  sort(arr.begin(), arr.end());

  for (int i = m-1; i >= 0; --i) {
    int ma = 0, idx = 0;
    for (int j = 0; j < MAXA; ++j)
      if (tot[j] > ma) {
	ma = tot[j];
	idx = j;
      }

    if (ma >= arr[i].first) {
      for (int j = 1; j <= n; ++j)
	if (vis[j] == arr[i].second) s[j-1] = 'a' + idx, --tot[idx];
    } else {
      puts("NO");
      return;
    }
  }

  puts("YES");
  puts(s);
}

int main()
{
  scanf("%s", s);
  n = strlen(s);
  solve();
  return 0;
}


#include <cstdio>
#include <vector>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;

const int MAXN = 1010;
const int MAXA = 26;

char s[MAXN];
int tot[MAXA], num[MAXN];
int g[MAXN][MAXN];
vector< pair<int, int> > arr;
int vis[MAXN];
int n, m;

int gcd(int x, int y) {
  return y == 0 ? x : gcd(y, x%y);
}

void dfs(int x)
{
  vis[x] = m;
  ++num[m];
  for (int i = 1; i <= n; ++i)
    if (!vis[i] && g[x][i]) {
      dfs(i);
    }
}

void solve()
{
  memset(tot, 0, sizeof(tot));
  for (int i = 0; i < n; ++i) ++tot[s[i]-'a'];

  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (gcd(i, j) > 1) g[i][j] = 1;

  m = 0;
  for (int i = 1; i <= n; ++i)
    if (!vis[i])  {
      ++m;
      dfs(i);
    }

  //  for (int i = 1; i <= n; ++i) printf("%d\n", vis[i]);

  arr.clear();
  for (int i = 1; i <= m; ++i) {
    arr.push_back( make_pair(num[i], i) );
  }

  sort(arr.begin(), arr.end());

  for (int i = m-1; i >= 0; --i) {
    int ma = 0, idx = 0;
    for (int j = 0; j < MAXA; ++j)
      if (tot[j] > ma) {
	ma = tot[j];
	idx = j;
      }

    if (ma >= arr[i].first) {
      for (int j = 1; j <= n; ++j)
	if (vis[j] == arr[i].second) s[j-1] = 'a' + idx, --tot[idx];
    } else {
      puts("NO");
      return;
    }
  }

  puts("YES");
  puts(s);
}

int main()
{
  scanf("%s", s);
  n = strlen(s);
  solve();
  return 0;
}


#include <cstdio>
#include <vector>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;

const int MAXN = 1010;
const int MAXA = 26;

char s[MAXN];
int tot[MAXA], num[MAXN];
vector< pair<int, int> > arr;
int vis[MAXN];
int n, m;

int gcd(int x, int y) {
  return y == 0 ? x : gcd(y, x%y);
}

void solve()
{
  for (int i = 0; i < n; ++i) ++tot[s[i]-'a'];

  for (int i = n; i >= 1; --i) {
    for (int j = i+1; j <= n; ++j)
      if (gcd(i, j) > 1) {
	vis[i] = vis[j];
	break;
      }

    if(vis[i] == 0)
      vis[i] = ++m;

    ++num[vis[i]];
  }

  //  for (int i = 1; i <= n; ++i) printf("%d\n", vis[i]);

  arr.clear();
  for (int i = 1; i <= m; ++i)
    arr.push_back( make_pair(num[i], i) );

  sort(arr.begin(), arr.end());

  for (int i = m-1; i >= 0; --i) {
    int ma = 0, idx = 0;
    for (int j = 0; j < MAXA; ++j)
      if (tot[j] > ma) {
	ma = tot[j];
	idx = j;
      }

    if (ma >= arr[i].first) {
      for (int j = 1; j <= n; ++j)
	if (vis[j] == arr[i].second) s[j-1] = 'a' + idx, --tot[idx];
    } else {
      puts("NO");
      return;
    }
  }

  puts("YES");
  puts(s);
}

int main()
{
  scanf("%s", s);
  n = strlen(s);
  solve();
  return 0;
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <ctime>
using namespace std;
typedef long long ll;
#define clr(x,a) memset(x,a,sizeof(x))
#define sz(x) (int)x.size()
#define see(x) cerr<<#x<<" "<<x<<endl
#define se(x) cerr<<" "<<x
#define pb push_back
#define mk make_pair
#define X first
#define Y second
const int inf = 1012345678;
const int maxn=1000;
int n,m;
int rd() {int x;scanf("%d",&x);return x;}

string s;
int f[maxn],in[maxn];
int prime[maxn],cnt;
void init()
{
	int i,j,k;
	cnt=0;
	prime[cnt++]=2;

	for(i=3; i<=1000; i+=2)
	{
		int flag=0;
		for(j=0; j<cnt; j++)
		if(i%prime[j]==0)
			flag=1;
		if(!flag)
			prime[cnt++]=i;
	}
}

int find(int x)
{
	int t=x;
	if(t!=f[t])
	{
		t=f[t];
	}
	int fa=t,tp;
	t=x;
	while(t!=f[t])
	{
		tp=f[t];
		f[t]=fa;
		t=tp;
	}
	return fa;
}
struct node
{
	int id,num;
	node(){}
	node(int a,int b){id=a,num=b;}
}a[maxn];

bool operator<(const node &a,const node &b)
{
	if(a.num==b.num)
		return a.id<b.id;
	return a.num<b.num;
}

priority_queue<node>q;
char to[maxn];
int main()
{
    //freopen("in","r",stdin);
    int i,j,k,t;

	init();
    while(cin>>s)
    {
    	clr(to,0);
    	clr(in,0);
    	clr(a,0);
    	int len=sz(s);
    	while(!q.empty())	q.pop();
    	for(i=0; i<len; i++)
    		in[s[i]-'a']++;
    	for(i=0; i<26; i++)
    		if(in[i])
    			q.push(node(i,in[i]));
    	for(i=0; i<=len; i++)
    		f[i]=i;
		for(i=0; prime[i]<=len; i++)
		{
			int tp=-1;
			int now=prime[i];
			int fu=find(now);
			for(j=now+now; j<=len ;j+=now)
			{
				int fv=find(j);
				if(fu!=fv)
				{
					f[fv]=fu;
				}
			}
		}
		for(i=1; i<=len ;i++)
    	{
    		a[i].id=i;
    		int fu=find(i);
    		a[fu].num++;
    	}
    	sort(a+1,a+1+len);
    	reverse(a+1,a+1+len);
    	int flag=0;
    	node now;

    	for(i=1; i<=len; i++)
    	{
    		now=q.top();q.pop();
    		if(now.num>=a[i].num)
    		{
    			to[a[i].id]=now.id+'a';
    			now.num-=a[i].num;
    			if(now.num)
    			{
    				q.push(now);
    			}
    		}
    		else
    		{
    			flag=1;
    			break;
    		}
   	 	}
    	if(flag)
    		puts("NO");
    	else
    	{
    		puts("YES");
    		string a;
			for(i=1; i<=len; i++)
			{
				j=find(i);
				a+=to[j];
			}
    		printf("%s\n",a.c_str());
    	}
    }
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <ctime>
using namespace std;
typedef long long ll;
#define clr(x,a) memset(x,a,sizeof(x))
#define sz(x) (int)x.size()
#define see(x) cerr<<#x<<" "<<x<<endl
#define se(x) cerr<<" "<<x
#define pb push_back
#define mk make_pair
#define X first
#define Y second
const int inf = 1012345678;
const int maxn=2010;
int n,m;
int rd() {int x;scanf("%d",&x);return x;}

string s;
int f[maxn],in[maxn];
int prime[maxn],cnt;
void init()
{
        int i,j,k;
        cnt=0;
        prime[cnt++]=2;

        for(i=3; i<=2000; i+=2)
        {
                int flag=0;
                for(j=0; j<cnt; j++)
                if(i%prime[j]==0)
                        flag=1;
                if(!flag)
                        prime[cnt++]=i;
        }
}

int find(int x)
{
        int t=x;
        while(t!=f[t])
        {
                t=f[t];
        }
        int fa=t,tp;
        t=x;
        while(t!=f[t])
        {
                tp=f[t];
                f[t]=fa;
                t=tp;
        }
        return fa;
}
struct node
{
        int id,num;
        node(){}
        node(int a,int b){id=a,num=b;}
}a[maxn];

bool operator<(const node &a,const node &b)
{
        if(a.num==b.num)
                return a.id>b.id;
        return a.num>b.num;
}

priority_queue<node>q;
char to[maxn];

struct nod
{
	int id,num;
    nod(){}
    nod(int a,int b){id=a,num=b;}
};
bool operator<(const nod &a,const nod &b)
{
        if(a.num==b.num)
                return a.id>b.id;
        return a.num>b.num;
}

set<nod>st;
set<nod>::iterator it;
int main()
{
   // freopen("in","r",stdin);
    int i,j,k,t;

        init();
    while(cin>>s)
    {
    	st.clear();
        clr(to,0);
        clr(in,0);
        clr(a,0);
        int len=sz(s);
        while(!q.empty())       q.pop();
        for(i=0; i<len; i++)
                in[s[i]-'a']++;
        for(i=0; i<27; i++)
                if(in[i])
                        q.push(node(i,in[i]));
        for(i=0; i<=len; i++)
       		 f[i]=i;
        for(i=0; prime[i]<=len; i++)
        {
                int tp=-1;
                int now=prime[i];
                int fu=find(now);
                for(j=now+now; j<=len ;j+=now)
                {
                        int fv=find(j);
                        if(fu!=fv)
                        {
                                f[fv]=fu;
                        }
                }
        }
        for(i=1; i<=len ;i++)
        {
                a[i].id=i;
                int fu=find(i);
                //printf("%d ",fu);
                a[fu].num++;
        }
        int j=0;
        for(i=1; i<=len; i++)
        if(a[i].num)
        	st.insert(nod(a[i].id,a[i].num));
        //puts("");
        int flag=sz(st);
        node now;
        nod tp;
        int nn=0;
        while(!q.empty())
        {
            now=q.top();q.pop();
            it=st.lower_bound(nod(len+1,now.num));
			if(it!=st.end())
            {
            	tp=*it;
            	st.erase(tp);
                now.num-=tp.num;
                to[tp.id]=now.id+'a';
                if(now.num)
                q.push(now);
                nn++;
            }
        }
        if(nn!=flag)
                puts("NO");
        else
        {
                puts("YES");
                string a;
                        for(i=1; i<=len; i++)
                        {
                                j=find(i);
                                a+=to[j];
                        //      printf("%d ",j);
                        }//puts("");
                printf("%s\n",a.c_str());
        }
    }
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <ctime>
using namespace std;
typedef long long ll;
#define clr(x,a) memset(x,a,sizeof(x))
#define sz(x) (int)x.size()
#define see(x) cerr<<#x<<" "<<x<<endl
#define se(x) cerr<<" "<<x
#define pb push_back
#define mk make_pair
#define X first
#define Y second
const int inf = 1012345678;
const int maxn=1010;
int n,m;
int rd() {int x;scanf("%d",&x);return x;}

string s;
int f[maxn],in[maxn];
int prime[maxn],cnt;
void init()
{
	int i,j,k;
	cnt=0;
	prime[cnt++]=2;

	for(i=3; i<=1000; i+=2)
	{
		int flag=0;
		for(j=0; j<cnt; j++)
		if(i%prime[j]==0)
			flag=1;
		if(!flag)
			prime[cnt++]=i;
	}
}

int find(int x)
{
	int t=x;
	if(t!=f[t])
	{
		t=f[t];
	}
	int fa=t,tp;
	t=x;
	while(t!=f[t])
	{
		tp=f[t];
		f[t]=fa;
		t=tp;
	}
	return fa;
}
struct node
{
	int id,num;
	node(){}
	node(int a,int b){id=a,num=b;}
}a[maxn];

bool operator<(const node &a,const node &b)
{
	if(a.num==b.num)
		return a.id<b.id;
	return a.num>b.num;
}

priority_queue<node>q;
char to[maxn];
int main()
{
    //freopen("in","r",stdin);
    int i,j,k,t;

	init();
    while(cin>>s)
    {
    	clr(to,0);
    	clr(in,0);
    	clr(a,0);
    	int len=sz(s);
    	while(!q.empty())	q.pop();
    	for(i=0; i<len; i++)
    		in[s[i]-'a']++;
    	for(i=0; i<26; i++)
    		if(in[i])
    			q.push(node(i,in[i]));
    	for(i=0; i<=len; i++)
    		f[i]=i;
		for(i=0; prime[i]<=len; i++)
		{
			int tp=-1;
			int now=prime[i];
			int fu=find(now);
			for(j=now+now; j<=len ;j+=now)
			{
				int fv=find(j);
				if(fu!=fv)
				{
					f[fv]=fu;
				}
			}
		}
		for(i=1; i<=len ;i++)
    	{
    		a[i].id=i;
    		int fu=find(i);
    		a[fu].num++;
    	}
    	sort(a+1,a+1+len);
    	int flag=0;
    	node now;
    	int nn=len;
		while(!q.empty())
		{
    		now=q.top();q.pop();
    		for(i=1; i<=len; i++)
    		{
    			if(a[i].num<=now.num)
    				break;
    		}
    		if(a[i].num!=0)
    		{
    			now.num-=a[i].num;
    			a[i].num=0;
    			to[a[i].id]=now.id+'a';
    			if(now.num)
    			q.push(now);
    			sort(a+1,a+1+nn);
    			nn--;
    		}
    	}
    	for(i=1; i<=len; i++)
    		if(a[i].num)
    			flag=1;
    	if(flag)
    		puts("NO");
    	else
    	{
    		puts("YES");
    		string a;
			for(i=1; i<=len; i++)
			{
				j=find(i);
				a+=to[j];
			}
    		printf("%s\n",a.c_str());
    	}
    }
}


#include<stdlib.h>
#include<stdio.h>
#include<string.h>

void chushihua();//初始化函数
int search(char *buf,int type,int command);
/*
 根据不同命令查表或造表函数
 buf:需要查找的字符串
 type:表的文件类型 ，1、关键字表2、标识符表3、常数表4、运算、限界符表5.常字符串表
 command: 控制命令，1表示只需查表，2表示若查不到还需造表
*/
void dealNum(char *buffer);//数字串处理函数
void dealConstantString(char *buffer);//常字符串处理函数
void dealString(char *buffer);//字符串处理函数
void dealError(char error,int lines,int rows);//出错处理函数
void scanner();//扫描程序

main()
{
    printf(" _________________________________________________________________________ \n"
           "|                                                                         |\n"
           "|   1.请输入要分析的C语言源程序文件名                                     |\n"
           "|   2.程序执行后会生成六个文件：key.txt(关键字表),relop.txt(运算、限界符  |\n"
           "|     表), id.txt（标识符表）,num.txt（常数表）,literal.txt（常字符串表） |\n"
           "|     ,output.txt（输出文件）                                             |\n"
           "|_________________________________________________________________________|\n");
    chushihua();//初始化
    scanner();//扫描源程序

    system("pause");
	return 0;
}

void chushihua()
{
    char *key[]={" ","auto","break","case","char","const","continue","default","do","double",
                 "else","enum","extern","float","for","goto","if","int","long","register",
                 "return","short","signed","sizeof","static","struct","switch","typedef",
                 "union","unsigned","void","volatile","while"};     //C语言所有关键字，共32个
    char *limit[]={" ","(",")","[","]","->",".","!","++","--","&","~",
                   "*","/","%","+","-","<<",">>","<","<=",">",">=","==","!=","&&","||",
                  "=","+=","-=","*=","/=",",",";","{","}","#","_","'",":","?"};//运算、限界符
    FILE *fptr;
    int i;//计数器
    char c;//一个字符

    fptr=fopen("key.txt","w");
    for(i=1;i<=32;i++)
       fprintf(fptr,"%s\n",key[i]);
    fclose(fptr);               //初始化关键字表
    fptr=fopen("relop.txt","w");
    for(i=1;i<=40;i++)
       fprintf(fptr,"%s\n",limit[i]);
    c='"';
    fprintf(fptr,"%c\n",c);
    fclose(fptr);               //初始化运算、限界符表
    fptr=fopen("id.txt","w");
    fclose(fptr);               //初始化标识符表
    fptr=fopen("num.txt","w");
    fclose(fptr);               //初始化常数表
    fptr=fopen("literal.txt","w");
    fclose(fptr);               //初始化常字符串表
    fptr=fopen("output.txt","w");
    fclose(fptr);               //初始化输出文件
}

int search(char *buf,int type,int command)
{
    int number=0;//表中序号，一行代表一号，也表示入口指针
    FILE *fptr;
    char c;
    char temp[100];//临时字符数组
    int i=0;

    switch(type)//根据不同文件类型读文件。1、关键字表2、标识符表3、常数表4、运算、限界符表
    {
        case 1:
             fptr=fopen("key.txt","r");
             break;
        case 2:
             fptr=fopen("id.txt","r");
             break;
        case 3:
             fptr=fopen("num.txt","r");
             break;
        case 4:
             fptr=fopen("relop.txt","r");
             break;
        case 5:
             fptr=fopen("literal.txt","r");
             break;
        default : break;
    }

    c=fgetc(fptr);
    while(c!=EOF)//遍历文件
    {
        while(c!='\n')//读入一行字符，将其存入临进缓冲区中
        {
            temp[i++]=c;
            c=fgetc(fptr);
        }
        temp[i]='\0';
        i=0;
        number++;//记录表中序号，每增一行序号数加一
        if(strcmp(temp,buf)==0)
        {
		    fclose(fptr);
			return(number);//若找到，返回在相应表中的序号
        }
        else
           c=fgetc(fptr);
     }

     if(command==1)//只需查表
     {
	     fclose(fptr);
		 return(0);//找不到，当只需查表，返回0，否则还需造表
     }
     switch(type)//根据不同文件类型造表。1、关键字表2、标识符表3、常数表4、运算、限界符表
     {
         case 1:
              fptr=fopen("key.txt","a");
              break;
         case 2:
              fptr=fopen("id.txt","a");
              break;
         case 3:
              fptr=fopen("num.txt","a");
              break;
         case 4:
              fptr=fopen("relop.txt","a");
              break;
         case 5:
              fptr=fopen("literal.txt","a");
              break;
         default : break;
     }
     fprintf(fptr,"%s\n",buf);//将字符串添加到表尾
     fclose(fptr);
     return (number+1);//造表时，将字符串添加到表尾并返回序号值
}

void dealNum(char *buffer)
{
    FILE *fptr;
	int result;//查找结果，即常数表入口指针

    result=search(buffer,3,2);//先查常数表，若找不到则加入常数表，返回序号值
    fptr=fopen("output.txt","a");
	fprintf(fptr,"%s\t\t\t3\t\t\t%d\n",buffer,result);//按照“字符串 记号 属性”的格式输出
	fclose(fptr);//写入输出文件
}

void dealConstantString(char *buffer)
{
    FILE *fptr;
	int result;//查找结果，即常表符串表入口指针

    result=search(buffer,5,2);//先查常字符串表，若找不到则加入常字符串表，返回序号值
    fptr=fopen("output.txt","a");
	fprintf(fptr,"%s\t\t\t5\t\t\t%d\n",buffer,result);//按照“字符串 记号 属性”的格式输出
	fclose(fptr);//写入输出文件
}

void dealString(char *buffer)
{
    FILE *fptr;
    int result;//查找结果，即关键字表入口指针，若没找到则返回0

    result=search(buffer,1,1);//先查关键字表
    fptr=fopen("output.txt","a");
    if(result!=0)
       fprintf(fptr,"%s\t\t\t1\t\t\t%d\n",buffer,result);//若找到，写入输出文件
    else
    {
        result=search(buffer,2,2);//若找不到，则非关键字，查标识符表，还找不到则加入标识符表
        fprintf(fptr,"%s\t\t\t2\t\t\t%d\n",buffer,result);
    }//写入输出文件
    fclose(fptr);
}

void dealError(char error,int lines,int rows)
{
    printf("\nerror: %c ,line %d,row %d\n",error,lines,rows);//报告出错符号和所在行数
}

void scanner()
{
    FILE *sourcePtr,*destPtr;//输入输出文件指针
    char filename[40];//文件名
    char ch;//一个字符
    int i=0;//计数器
    int sign;//标志符，0表示注释开始,1表示可能结束，2表示注释结束
    int result;//查表结果
    int errors=0;//错误数
	char temp[100];//临时存储字符串
    char *word;//一个单词
    int state=0;//状态
    int line=1,row=1;//行数，列数
    int words=0;//单词个数
    int letters=0;//字符个数

	printf("\n请输入文件名(带后缀'.cpp'):");
    scanf("%s",filename);//输入要分析的C语言源程序名

    if((sourcePtr=fopen(filename,"r"))==NULL)
    {
        printf("无法打开文件！");
        return ;
    }
    ch=fgetc(sourcePtr);//读入第一个字符
    while(ch!=EOF)//遍历源文件
    {//按字符依次扫描源程序，直至结束
        i=0;
        if(((ch>='A')&&(ch<='Z'))||((ch>='a')&&(ch<='z'))||(ch=='_'))//标识符状态
        {//以字母开头
            while(((ch>='A')&&(ch<='Z'))||((ch>='a')&&(ch<='z'))||(ch=='_')||((ch>='0')&&(ch<='9')))//识别出一个标识符，并存入临时数组中
            {
                temp[i++]=ch;
                ch=fgetc(sourcePtr);
                row++;//列数增加一位
            }
            words++;//单词数加1
            word=(char *)malloc((i+1)*sizeof(char));//动态申请空间
			memcpy(word,temp,i);//复制字符串
			word[i]='\0';
            dealString(word);//处理字符串
            if(ch!=EOF)//将文件指针前移一个字符的位置
            {
			   fseek(sourcePtr,-1L,SEEK_CUR);
			   row--;//列数减少一位
            }
        }
        else if(ch>='0'&&ch<='9')//数字状态
        {//以数字开头
            temp[i++]=ch;
            state=0;
            while (state<6)//根据不同的状态进行分析,6为结束状态，7为错误状态
            {
                  ch=fgetc(sourcePtr);
                  row++;
                  switch(state)
                  {
                         case 0:
                              if (ch>='0'&&ch<='9');
                              else if (ch=='.')
                                      state=1;
                                   else if (ch=='E'||ch=='e')
                                            state=3;
                                        else
                                        {
                                            state=6;
                                            break;
                                        }
                              temp[i++]=ch;
                              break;
                         case 1:
                              if (ch>='0'&&ch<='9')
                              {
                                 state=2;
                                 temp[i++]=ch;
                              }
                              else
                              {
                                 dealError(ch,line,row);//发生错误
                                 state=7;
                                 errors++;
                              }
                              break;
                         case 2:
                              if (ch>='0'&&ch<='9');
                              else if (ch=='e'||ch=='E')
                                      state=3;
                                   else
                                   {
                                      state=6;
                                      break;
                                   }
                              temp[i++]=ch;
                              break;
                         case 3:
                              if (ch>='0'&&ch<='9')
                                 state=5;
                              else if (ch=='+'||ch=='-')
                                      state=4;
                                   else
                                   {
                                      dealError(ch,line,row);
                                      state=7;
                                      errors++;
                                      break;
                                   }
                              temp[i++]=ch;
                              break;
                         case 4:
                              if (ch>='0'&&ch<='9')
                              {
                                 state=5;
                                 temp[i++]=ch;
                              }
                              else
                              {
                                 dealError(ch,line,row);
                                 state=7;
                                 errors++;
                              }
                              break;
                         case 5:
                              if (ch>='0'&&ch<='9')
                                 temp[i++]=ch;
                              else
                                 state=6;
                              break;
                         default: break;
                  }
            }

           if (state==6)//无符号数识别结束，未发现错误
           {
                words++;
                word=(char *)malloc((i+1)*sizeof(char));
		    	memcpy(word,temp,i);
		    	word[i]='\0';
                dealNum(word);//处理数字
                if(ch!=EOF)
                {
			      fseek(sourcePtr,-1L,SEEK_CUR);
			      row--;
                }
           }
        }
        else if((ch==' ')||(ch=='\t'));//消除空格符和水平制表符
		else if(ch=='\n')
		{
            letters=letters+row;//一行后统计字符数
            row=0;//列数归零
			line++;//消除回车并记录行数
        }
		else if(ch=='/')
        {//消除注释
			ch=fgetc(sourcePtr);
			row++;
			if(ch=='=')
			{//判断是否为‘/=’符号
			    words++;
				destPtr=fopen("output.txt","a");
				fprintf(destPtr,"/=\t\t\t4\t\t\t32\n");
                fclose(destPtr);
			}
			else if (ch=='/')//以//开头的注释
                 {
                    letters=letters+row;
                    printf("line %d has commentary:\n",line);
                    while (ch!='\n')
                    {
                          ch=fgetc(sourcePtr);
                          row++;
                          printf("%c",ch);
                    }
                    printf("\n");
                    line++;
                    row=0;
                 }
			else if(ch!='*')
            {//若为除号，写入输出文件
                destPtr=fopen("output.txt","a");
				fprintf(destPtr,"/\t\t\t4\t\t\t13\n");
                fclose(destPtr);
				fseek(sourcePtr,-1L,SEEK_CUR);
				row--;
			}
            else
			{//若为注释的开始，输出包含在里面的所有字符
			    letters=letters+row;
			    printf("line %d has commentary:\n",line);
				sign=0;//标志符，0表示注释开始,1表示可能结束，2表示注释结束
				ch=fgetc(sourcePtr);
				row++;
				while(sign!=2)
                {//当扫描到‘*’且紧接着下一个字符为‘/’才是注释的结束
					sign=0;
					while(ch!='*')
					{
                        if (ch=='\n')//换行时进行相关行列变量操作
                        {
                           line++;
                           row=0;
                        }
                        printf("%c",ch);
						ch=fgetc(sourcePtr);
						row++;
                    }
					sign++;//注释可能结束
					ch=fgetc(sourcePtr);
					row++;
					if(ch=='/')//注释结束
					{
                        printf("\n");
						sign++;
                    }
					else
					{
                        printf("*");
                        if (ch=='\n')
                        {
                           line++;
                           row=0;
                        }
                        if (ch!='*')
                        {
                           printf("%c",ch);
                           ch=fgetc(sourcePtr);
                           row++;
                        }
                   }
				}
			}
		}
		else if (ch=='\'')//字符常量
		{
             words++;
             destPtr=fopen("output.txt","a");
			 fprintf(destPtr,"%c\t\t\t4\t\t\t38\n",ch);
			 fclose(destPtr);
             ch=fgetc(sourcePtr);
             row++;
             if (ch=='\\')//处理转义字符
             {
                word=(char *)malloc(3*sizeof(char));
                ch=fgetc(sourcePtr);
                row++;
                word[0]='\\';
                word[1]=ch;
                word[2]='\0';
             }
             else//处理普通字符
             {
                 word=(char *)malloc(2*sizeof(char));
                 word[0]=ch;
                 word[1]='\0';
             }
             dealConstantString(word);
             ch=fgetc(sourcePtr);
             row++;
             if (ch=='\'')
             {
                destPtr=fopen("output.txt","a");
			    fprintf(destPtr,"%c\t\t\t4\t\t\t38\n",ch);
			    fclose(destPtr);
             }
             else
             {
                 dealError(ch,line,row);
                 errors++;
             }
        }
        else if(ch=='"')//字符串常量
		{//消除包含在双引号中的字符串常量
		    words++;
			destPtr=fopen("output.txt","a");
			fprintf(destPtr,"%c\t\t\t4\t\t\t41\n",ch);
			fclose(destPtr);
			ch=fgetc(sourcePtr);
            row++;
			while(ch!='"')
			{
                temp[i++]=ch;
				ch=fgetc(sourcePtr);
				row++;
            }
            word=(char *)malloc((i+1)*sizeof(char));//动态申请空间
			memcpy(word,temp,i);//复制字符串
			word[i]='\0';
            dealConstantString(word);//处理字符串
            destPtr=fopen("output.txt","a");
            fprintf(destPtr,"%c\t\t\t4\t\t\t41\n",ch);
			fclose(destPtr);
		}
		else
        {//首字符为其它字符,即运算限界符或非法字符*/
            temp[0]=ch;
            ch=fgetc(sourcePtr);//再读入下一个字符，判断是否为双字符运算、限界符
            row++;
            if(ch!=EOF)
            {//若该字符非文件结束符
                temp[1]=ch;
				word=(char *)malloc(3*sizeof(char));
				memcpy(word,temp,2);
				word[2]='\0';
                result=search(word,4,1);//先检索是否为双字符运算、限界符
				if(result==0)
				{//若不是
                    word=(char *)malloc(2*sizeof(char));
					memcpy(word,temp,1);
					word[1]='\0';
					result=search(word,4,1);//检索是否为单字符运算、限界符
					if(result==0)
                    {//若还不是，则为非法字符
						row--;
						dealError(temp[0],line,row);
						errors++;
                        fseek(sourcePtr,-1L,SEEK_CUR);
                    }
                    else
					{//若为单字符运算、限界符，写入输出文件并将扫描文件指针回退一个字符
						destPtr=fopen("output.txt","a");
						fprintf(destPtr,"%s\t\t\t4\t\t\t%d\t\n",word,result);
						fclose(destPtr);
						fseek(sourcePtr,-1L,SEEK_CUR);
						row--;
					}
				}
                else
				{//若为双字符运算、限界符，写输出文件
				    words++;
					destPtr=fopen("output.txt","a");
					fprintf(destPtr,"%s\t\t\t4\t\t\t%d\n",word,result);
					fclose(destPtr);
				}
            }
            else
			{//若读入的下一个字符为文件结束符
				word=(char *)malloc(2*sizeof(char));
				memcpy(word,temp,1);
				word[1]='\0';
				result=search(word,4,1);//只考虑是否为单字符运算、限界符
				if(result==0)//若不是，转出错处理
					dealError(temp[0],line,row);
				else
				{//若是，写输出文件
					destPtr=fopen("output.txt","a");
					fprintf(destPtr,"%s\t\t\t4\t\t\t%d\n",word,result);
					fclose(destPtr);
				}
			}
        }
        ch=fgetc(sourcePtr);
        row++;
    }
    fclose(sourcePtr);

	printf("\n共有 %d 个错误.\n",errors);//报告错误字符个数
	printf("全文有 %d 行.\n",line);//报告语句行数
	printf("包含 %d 个单词.\n",words);//报告单词个数
	printf("有 %d 个字符.\n\n",letters);//报告字符个数
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <ctime>
using namespace std;
typedef long long ll;
#define clr(x,a) memset(x,a,sizeof(x))
#define sz(x) (int)x.size()
#define see(x) cerr<<#x<<" "<<x<<endl
#define se(x) cerr<<" "<<x
#define pb push_back
#define mk make_pair
#define X first
#define Y second
const int inf = 1012345678;
const int maxn=1010;
int n,m;
int rd() {int x;scanf("%d",&x);return x;}

string s;
int f[maxn],in[maxn];
int prime[maxn],cnt;
void init()
{
	int i,j,k;
	cnt=0;
	prime[cnt++]=2;

	for(i=3; i<=1000; i+=2)
	{
		int flag=0;
		for(j=0; j<cnt; j++)
		if(i%prime[j]==0)
			flag=1;
		if(!flag)
			prime[cnt++]=i;
	}
}

int find(int x)
{
	int t=x;
	if(t!=f[t])
	{
		t=f[t];
	}
	int fa=t,tp;
	t=x;
	while(t!=f[t])
	{
		tp=f[t];
		f[t]=fa;
		t=tp;
	}
	return fa;
}
struct node
{
	int id,num;
	node(){}
	node(int a,int b){id=a,num=b;}
}a[maxn];

bool operator<(const node &a,const node &b)
{
	if(a.num==b.num)
		return a.id<b.id;
	return a.num>b.num;
}

priority_queue<node>q;
char to[maxn];
int main()
{
    //freopen("in","r",stdin);
    int i,j,k,t;

	init();
    while(cin>>s)
    {
    	clr(to,0);
    	clr(in,0);
    	clr(a,0);
    	int len=sz(s);
    	while(!q.empty())	q.pop();
    	for(i=0; i<len; i++)
    		in[s[i]-'a']++;
    	for(i=0; i<26; i++)
    		if(in[i])
    			q.push(node(i,in[i]));
    	for(i=0; i<=len; i++)
    		f[i]=i;
		for(i=0; prime[i]<=len; i++)
		{
			int tp=-1;
			int now=prime[i];
			int fu=find(now);
			for(j=now+now; j<=len ;j+=now)
			{
				int fv=find(j);
				if(fu!=fv)
				{
					f[fv]=fu;
				}
			}
		}
		for(i=1; i<=len ;i++)
    	{
    		a[i].id=i;
    		int fu=find(i);
    		a[fu].num++;
    	}
    	sort(a+1,a+1+len);
    	int flag=0;
    	node now;
    	int nn=len;
		while(!q.empty())
		{
    		now=q.top();q.pop();
    		for(i=1; i<=len; i++)
    		{
    			if(a[i].num<=now.num)
    				break;
    		}
    		if(a[i].num!=0)
    		{
    			now.num-=a[i].num;
    			a[i].num=0;
    			to[a[i].id]=now.id+'a';
    			if(now.num)
    			q.push(now);
    			sort(a+1,a+1+len);
    		}
    	}
    	for(i=1; i<=len; i++)
    		if(a[i].num)
    			flag=1;
    	if(flag)
    		puts("NO");
    	else
    	{
    		puts("YES");
    		string a;
			for(i=1; i<=len; i++)
			{
				j=find(i);
				a+=to[j];
			}
    		printf("%s\n",a.c_str());
    	}
    }
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <ctime>
using namespace std;
typedef long long ll;
#define clr(x,a) memset(x,a,sizeof(x))
#define sz(x) (int)x.size()
#define see(x) cerr<<#x<<" "<<x<<endl
#define se(x) cerr<<" "<<x
#define pb push_back
#define mk make_pair
#define X first
#define Y second
const int inf = 1012345678;
const int maxn=1010;
int n,m;
int rd() {int x;scanf("%d",&x);return x;}

string s;
int f[maxn],in[maxn];
int prime[maxn],cnt;
void init()
{
	int i,j,k;
	cnt=0;
	prime[cnt++]=2;

	for(i=3; i<=1000; i+=2)
	{
		int flag=0;
		for(j=0; j<cnt; j++)
		if(i%prime[j]==0)
			flag=1;
		if(!flag)
			prime[cnt++]=i;
	}
}

int find(int x)
{
	int t=x;
	while(t!=f[t])
	{
		t=f[t];
	}
	int fa=t,tp;
	t=x;
	while(t!=f[t])
	{
		tp=f[t];
		f[t]=fa;
		t=tp;
	}
	return fa;
}
struct node
{
	int id,num;
	node(){}
	node(int a,int b){id=a,num=b;}
}a[maxn];

bool operator<(const node &a,const node &b)
{
	if(a.num==b.num)
		return a.id>b.id;
	return a.num>b.num;
}

priority_queue<node>q;
char to[maxn];
int main()
{
    //freopen("in","r",stdin);
    int i,j,k,t;

	init();
    while(cin>>s)
    {
    	clr(to,0);
    	clr(in,0);
    	clr(a,0);
    	int len=sz(s);
    	while(!q.empty())	q.pop();
    	for(i=0; i<len; i++)
    		in[s[i]-'a']++;
    	for(i=0; i<27; i++)
    		if(in[i])
    			q.push(node(i,in[i]));
    	for(i=0; i<=len; i++)
    		f[i]=i;
		for(i=0; prime[i]<=len; i++)
		{
			int tp=-1;
			int now=prime[i];
			int fu=find(now);
			for(j=now+now; j<=len ;j+=now)
			{
				int fv=find(j);
				if(fu!=fv)
				{
					f[fv]=fu;
				}
			}
		}
		for(i=1; i<=len ;i++)
    	{
    		a[i].id=i;
    		int fu=find(i);
    		//printf("%d ",fu);
    		a[fu].num++;
    	}
    	//puts("");
    	sort(a+1,a+1+len);
    	int flag=0;
    	node now;
    	int nn=len;
		while(!q.empty())
		{
    		now=q.top();q.pop();
    		for(i=1; i<=len; i++)
    		{
    			if(a[i].num<=now.num)
    				break;
    		}
    		if(a[i].num!=0 && a[i].num<=now.num)
    		{
    			now.num-=a[i].num;
    			a[i].num=0;
    			to[a[i].id]=now.id+'a';
    			if(now.num)
    			q.push(now);
    			sort(a+1,a+1+len);
    		}
    	}
    	for(i=1; i<=len; i++)
    		if(a[i].num)
    			flag=1;
    	if(flag)
    		puts("NO");
    	else
    	{
    		puts("YES");
    		string a;
			for(i=1; i<=len; i++)
			{
				j=find(i);
				a+=to[j];
			//	printf("%d ",j);
			}//puts("");
    		printf("%s\n",a.c_str());
    	}
    }
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <ctime>
using namespace std;
typedef long long ll;
#define clr(x,a) memset(x,a,sizeof(x))
#define sz(x) (int)x.size()
#define see(x) cerr<<#x<<" "<<x<<endl
#define se(x) cerr<<" "<<x
#define pb push_back
#define mk make_pair
#define X first
#define Y second
const int inf = 1012345678;
const int maxn=1010;
int n,m;
int rd() {int x;scanf("%d",&x);return x;}

string s;
int f[maxn],in[maxn];
int prime[maxn],cnt;
void init()
{
	int i,j,k;
	cnt=0;
	prime[cnt++]=2;

	for(i=3; i<=1000; i+=2)
	{
		int flag=0;
		for(j=0; j<cnt; j++)
		if(i%prime[j]==0)
			flag=1;
		if(!flag)
			prime[cnt++]=i;
	}
}

int find(int x)
{
	int t=x;
	while(t!=f[t])
	{
		t=f[t];
	}
	int fa=t,tp;
	t=x;
	while(t!=f[t])
	{
		tp=f[t];
		f[t]=fa;
		t=tp;
	}
	return fa;
}
struct node
{
	int id,num;
	node(){}
	node(int a,int b){id=a,num=b;}
}a[maxn];

bool operator<(const node &a,const node &b)
{
	if(a.num==b.num)
		return a.id>b.id;
	return a.num>b.num;
}
int find(int l,int r,int x)
{
	int i,j,k,ans=-1;
	while(l<=r)
	{
		int mid=(l+r)/2;
		if(a[mid].num<=x)
			ans=mid,l=mid+1;
		else
			r=mid-1;
	}
	return ans;
}
priority_queue<node>q;
char to[maxn];
int main()
{
    //freopen("in","r",stdin);
    int i,j,k,t;

	init();
    while(cin>>s)
    {
    	clr(to,0);
    	clr(in,0);
    	clr(a,0);
    	int len=sz(s);
    	while(!q.empty())	q.pop();
    	for(i=0; i<len; i++)
    		in[s[i]-'a']++;
    	for(i=0; i<27; i++)
    		if(in[i])
    			q.push(node(i,in[i]));
    	for(i=0; i<=len; i++)
    		f[i]=i;
		for(i=0; prime[i]<=len; i++)
		{
			int tp=-1;
			int now=prime[i];
			int fu=find(now);
			for(j=now+now; j<=len ;j+=now)
			{
				int fv=find(j);
				if(fu!=fv)
				{
					f[fv]=fu;
				}
			}
		}
		for(i=1; i<=len ;i++)
    	{
    		a[i].id=i;
    		int fu=find(i);
    		a[fu].num++;
    	}
    	//puts("");
    	sort(a+1,a+1+len);
    	int flag=0;
    	node now;
    	int nn=len;
		while(!q.empty())
		{
    		now=q.top();q.pop();
    		i=find(1,nn,now.num);
    		if(i>0 && a[i].num<=now.num)
    		{
    			now.num-=a[i].num;
    			a[i].num=0;
    			to[a[i].id]=now.id+'a';
    			if(now.num)
    			q.push(now);
    			sort(a+1,a+1+nn);
    			nn--;
    		}
    	}
    	for(i=1; i<=len; i++)
    		if(a[i].num)
    			flag=1;
    	if(flag)
    		puts("NO");
    	else
    	{
    		puts("YES");
    		string a;
			for(i=1; i<=len; i++)
			{
				j=find(i);
				a+=to[j];
			}
    		printf("%s\n",a.c_str());
    	}
    }
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <ctime>
using namespace std;
typedef long long ll;
#define clr(x,a) memset(x,a,sizeof(x))
#define sz(x) (int)x.size()
#define see(x) cerr<<#x<<" "<<x<<endl
#define se(x) cerr<<" "<<x
#define pb push_back
#define mk make_pair
#define X first
#define Y second
const int inf = 1012345678;
const int maxn=1010;
int n,m;
int rd() {int x;scanf("%d",&x);return x;}

string s;
int f[maxn],in[maxn];
int prime[maxn],cnt;
void init()
{
        int i,j,k;
        cnt=0;
        prime[cnt++]=2;

        for(i=3; i<=1000; i+=2)
        {
                int flag=0;
                for(j=0; j<cnt; j++)
                if(i%prime[j]==0)
                        flag=1;
                if(!flag)
                        prime[cnt++]=i;
        }
}

int find(int x)
{
        int t=x;
        while(t!=f[t])
        {
                t=f[t];
        }
        int fa=t,tp;
        t=x;
        while(t!=f[t])
        {
                tp=f[t];
                f[t]=fa;
                t=tp;
        }
        return fa;
}
struct node
{
        int id,num;
        node(){}
        node(int a,int b){id=a,num=b;}
}a[maxn];

bool operator<(const node &a,const node &b)
{
        if(a.num==b.num)
                return a.id>b.id;
        return a.num>b.num;
}

priority_queue<node>q;
char to[maxn];

struct nod
{
	int id,num;
    nod(){}
    nod(int a,int b){id=a,num=b;}
};
bool operator<(const nod &a,const nod &b)
{
        if(a.num==b.num)
                return a.id>b.id;
        return a.num>b.num;
}

set<nod>st;
set<nod>::iterator it;
int main()
{
 //   freopen("in","r",stdin);
    int i,j,k,t;

        init();
    while(cin>>s)
    {
    	st.clear();
        clr(to,0);
        clr(in,0);
        clr(a,0);
        int len=sz(s);
        while(!q.empty())       q.pop();
        for(i=0; i<len; i++)
                in[s[i]-'a']++;
        for(i=0; i<27; i++)
                if(in[i])
                        q.push(node(i,in[i]));
        for(i=0; i<=len; i++)
                f[i]=i;
                for(i=0; prime[i]<=len; i++)
                {
                        int tp=-1;
                        int now=prime[i];
                        int fu=find(now);
                        for(j=now+now; j<=len ;j+=now)
                        {
                                int fv=find(j);
                                if(fu!=fv)
                                {
                                        f[fv]=fu;
                                }
                        }
                }
        for(i=1; i<=len ;i++)
        {
                a[i].id=i;
                int fu=find(i);
                //printf("%d ",fu);
                a[fu].num++;
        }
        int j=0;
        for(i=1; i<=len; i++)
        if(a[i].num)
        	st.insert(nod(a[i].id,a[i].num));
        //puts("");
        int flag=sz(st);
        node now;
        nod tp;
        int nn=0;
        while(!q.empty())
        {
            now=q.top();q.pop();
            it=st.lower_bound(nod(len+1,now.num));
			if(it!=st.end())
            {
            	tp=*it;
            	st.erase(tp);
                now.num-=tp.num;
                to[tp.id]=now.id+'a';
                if(now.num)
                q.push(now);
                nn++;
            }
        }
        if(nn!=flag)
                puts("NO");
        else
        {
                puts("YES");
                string a;
                        for(i=1; i<=len; i++)
                        {
                                j=find(i);
                                a+=to[j];
                        //      printf("%d ",j);
                        }//puts("");
                printf("%s\n",a.c_str());
        }
    }
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <ctime>
using namespace std;
typedef long long ll;
#define clr(x,a) memset(x,a,sizeof(x))
#define sz(x) (int)x.size()
#define see(x) cerr<<#x<<" "<<x<<endl
#define se(x) cerr<<" "<<x
#define pb push_back
#define mk make_pair
#define X first
#define Y second
const int inf = 1012345678;
const int maxn=1010;
int n,m;
int rd() {int x;scanf("%d",&x);return x;}

string s;
int f[maxn],in[maxn];
int prime[maxn],cnt;
void init()
{
	int i,j,k;
	cnt=0;
	prime[cnt++]=2;

	for(i=3; i<=1000; i+=2)
	{
		int flag=0;
		for(j=0; j<cnt; j++)
		if(i%prime[j]==0)
			flag=1;
		if(!flag)
			prime[cnt++]=i;
	}
}

int find(int x)
{
	int t=x;
	while(t!=f[t])
	{
		t=f[t];
	}
	int fa=t,tp;
	t=x;
	while(t!=f[t])
	{
		tp=f[t];
		f[t]=fa;
		t=tp;
	}
	return fa;
}
struct node
{
	int id,num;
	node(){}
	node(int a,int b){id=a,num=b;}
}a[maxn];

bool operator<(const node &a,const node &b)
{
	if(a.num==b.num)
		return a.id>b.id;
	return a.num>b.num;
}

priority_queue<node>q;
char to[maxn];
int main()
{
    //freopen("in","r",stdin);
    int i,j,k,t;

	init();
    while(cin>>s)
    {
    	clr(to,0);
    	clr(in,0);
    	clr(a,0);
    	int len=sz(s);
    	while(!q.empty())	q.pop();
    	for(i=0; i<len; i++)
    		in[s[i]-'a']++;
    	for(i=0; i<27; i++)
    		if(in[i])
    			q.push(node(i,in[i]));
    	for(i=0; i<=len; i++)
    		f[i]=i;
		for(i=0; prime[i]<=len; i++)
		{
			int tp=-1;
			int now=prime[i];
			int fu=find(now);
			for(j=now+now; j<=len ;j+=now)
			{
				int fv=find(j);
				if(fu!=fv)
				{
					f[fv]=fu;
				}
			}
		}
		for(i=1; i<=len ;i++)
    	{
    		a[i].id=i;
    		int fu=find(i);
    		//printf("%d ",fu);
    		a[fu].num++;
    	}
    	//puts("");
    	sort(a+1,a+1+len);
    	int flag=0;
    	node now;
    	int nn=len;
		while(!q.empty())
		{
    		now=q.top();q.pop();
    		for(i=1; i<=nn; i++)
    		{
    			if(a[i].num<=now.num)
    				break;
    		}
    		if(a[i].num!=0 && a[i].num<=now.num)
    		{
    			now.num-=a[i].num;
    			a[i].num=0;
    			to[a[i].id]=now.id+'a';
    			if(now.num)
    			q.push(now);
    			sort(a+1,a+1+nn);
    			nn--;
    		}
    	}
    	for(i=1; i<=len; i++)
    		if(a[i].num)
    			flag=1;
    	if(flag)
    		puts("NO");
    	else
    	{
    		puts("YES");
    		string a;
			for(i=1; i<=len; i++)
			{
				j=find(i);
				a+=to[j];
			//	printf("%d ",j);
			}//puts("");
    		printf("%s\n",a.c_str());
    	}
    }
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
using namespace std;

#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define sz size()
#define xx first
#define yy second

#define repeach(i,x) for(typeof(x.begin()) i=x.begin(); i!=x.end(); ++i)
#define repreach(i,x) for(typeof(x.rbegin()) i=x.rbegin(); i!=x.rend(); ++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define repx(i,s,t) for(int i=(s);i<(t);++i)
#define repr(i,n) for(int i=(n)-1;i>=0;--i)
#define reprx(i,s,t) for(int i=(s)-1;i>=(t);--i)

#define mset memset
#define mcpy memcpy
#define mclr(x,sz) mset(x,0,sz)

#define N 1005
int gcd(int x, int y) { if(y==0) return x; return gcd(y, x%y); }
int p[N];
void init(int n) { rep(i, n+1) p[i]=i; }
int find(int x) { if(p[x]==x) return p[x]; return p[x] = find(p[x]); }
void uni(int x, int y) { p[find(x)] = p[find(y)]; }
void uni_fact(const int& x) { repx(i,2,x+1) if(x%i==0) uni(i, x); }
void fill_fact(const int& x, const char& e, string& s) { repx(i,2,x+1) if(gcd(i,x)!=1) s[i-1] = e; }
int cnt_fact (const int& x) { int cnt=0; repx(i,2,x+1) if(gcd(i,x)!=1) cnt ++; return cnt; }
bool is_prim(const int& x) { for(int i=2; i*i<=x; ++i) if(x%i==0) return false; return true; }
int main() {
	string s;
	cin >> s;
	map<char, int> cnt;
	rep(i, s.sz) cnt[s[i]] ++;
	init(1000);
	repx(i, 4, s.sz+1) uni_fact(i);
	map<int, int> k;
	repx(i, 1, s.sz+1) k[find(i)] ++;

	int d, v=0;
	repeach(itr, k) if(v < itr->second) v = itr->second, d = itr->first;

	//cout << d << " " << v << endl;
	string ss = s;
	rep(i, ss.sz) ss[i] = ' ';
	vector<pair<int, char> > vp;
	repeach(itr, cnt) vp.pb(mp(itr->second, itr->first));
	sort(all(vp), greater<pair<int, char> >());
	//repeach(itr, vp) cout << itr->first << " " << itr->second << endl;
	if(v > vp[0].first) {
		cout << "NO";
		return 0;
	}
	fill_fact(d, vp[0].second, ss);
	//cout << ss << endl;
	int count = cnt_fact(d);
	//cout << count << endl;
	vp[0].first -= count;
	int j=0;
	rep(i, ss.sz) if(ss[i]==' ') {
		if(vp[j].first == 0) j++;
		ss[i] = vp[j].second;
		vp[j].first --;
	}
	cout << "YES" << endl;
	cout << ss << endl;
	string sk;

	return 0;
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
using namespace std;

#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define sz size()
#define xx first
#define yy second

#define repeach(i,x) for(typeof(x.begin()) i=x.begin(); i!=x.end(); ++i)
#define repreach(i,x) for(typeof(x.rbegin()) i=x.rbegin(); i!=x.rend(); ++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define repx(i,s,t) for(int i=(s);i<(t);++i)
#define repr(i,n) for(int i=(n)-1;i>=0;--i)
#define reprx(i,s,t) for(int i=(s)-1;i>=(t);--i)

#define mset memset
#define mcpy memcpy
#define mclr(x,sz) mset(x,0,sz)
bool is_prim(const int& num) {
	for(int i=2; i*i <= num; ++i) if(num % i ==0) return false;
	return true;
}
int main() {
	string s;
	cin >> s;
	string ss = s;
	map<char, int> csum;
	priority_queue<pair<int, char> > q;
	rep(i, s.sz) csum[s[i]] ++;
	repeach(itr, csum) q.push(mp(itr->second, itr->first));
	repx(p, 2, s.sz+1) if(is_prim(p)) {
		pair<int, char> t = q.top();
		q.pop();
		//cout << t.first << " " << t.second << endl;
		if(t.first < s.sz / p) {
			cout << "NO";
			return 0;
		}
		for(int i=1; i*p <= s.sz; ++i) ss[i*p-1] = t.second;
		t.first -= s.sz / p;
		if(t.first > 0) q.push(t);
	}
	ss[0] = q.top().second;
	cout << "YES" << endl;
	cout << ss;
	return 0;
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
using namespace std;

#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define sz size()
#define xx first
#define yy second

#define repeach(i,x) for(typeof(x.begin()) i=x.begin(); i!=x.end(); ++i)
#define repreach(i,x) for(typeof(x.rbegin()) i=x.rbegin(); i!=x.rend(); ++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define repx(i,s,t) for(int i=(s);i<(t);++i)
#define repr(i,n) for(int i=(n)-1;i>=0;--i)
#define reprx(i,s,t) for(int i=(s)-1;i>=(t);--i)

#define mset memset
#define mcpy memcpy
#define mclr(x,sz) mset(x,0,sz)

int main () {
	string s;
	cin >> s;
	int n = s.sz;
	map<char, int> cht;
	rep(i,n) cht[s[i]]++;
	char chart;
	int chcnt=0;
	vector<pair<int, char> > vp;
	repeach(itr, cht) vp.pb(mp(itr->second, itr->first));
	sort(all(vp), greater<pair<int, char> >());
	string ss;
	repeach(itr, vp) while(itr->first--) ss+= itr->second;

	int front=0, rear = ss.sz;
	rep(i, n) {
		int x = i+1;
		if(x==1) s[i] = ss[--rear];
		else {
			if(x*2 <= s.sz) s[i] = ss[++front];
			else s[i] = ss[--rear];
		}
	}
	if(ss[front] != ss[0]) cout << "NO";
	else {
		cout << "YES" << endl;
		cout << s << endl;
	}
	return 0;
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
using namespace std;

#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define sz size()
#define xx first
#define yy second

#define repeach(i,x) for(typeof(x.begin()) i=x.begin(); i!=x.end(); ++i)
#define repreach(i,x) for(typeof(x.rbegin()) i=x.rbegin(); i!=x.rend(); ++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define repx(i,s,t) for(int i=(s);i<(t);++i)
#define repr(i,n) for(int i=(n)-1;i>=0;--i)
#define reprx(i,s,t) for(int i=(s)-1;i>=(t);--i)

#define mset memset
#define mcpy memcpy
#define mclr(x,sz) mset(x,0,sz)

int main () {
	string s;
	cin >> s;
	int n = s.sz;
	map<char, int> cht;
	rep(i,n) cht[s[i]]++;
	char chart;
	int chcnt=0;
	vector<pair<int, char> > vp;
	repeach(itr, cht) vp.pb(mp(itr->second, itr->first));
	sort(all(vp), greater<pair<int, char> >());
	string ss;
	repeach(itr, vp) while(itr->first--) ss+= itr->second;

	int front=0, rear = ss.sz;
	rep(i, n) {
		int x = i+1;
		if(x==1) s[i] = ss[--rear];
		else {
			if(x*2 <= n) s[i] = ss[front++];
			else s[i] = ss[--rear];
		}
	}
	if(ss[front] != ss[0]) cout << "NO";
	else {
		cout << "YES" << endl;
		cout << s << endl;
	}
	return 0;
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
using namespace std;

#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define sz size()
#define xx first
#define yy second

#define repeach(i,x) for(typeof(x.begin()) i=x.begin(); i!=x.end(); ++i)
#define repreach(i,x) for(typeof(x.rbegin()) i=x.rbegin(); i!=x.rend(); ++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define repx(i,s,t) for(int i=(s);i<(t);++i)
#define repr(i,n) for(int i=(n)-1;i>=0;--i)
#define reprx(i,s,t) for(int i=(s)-1;i>=(t);--i)

#define mset memset
#define mcpy memcpy
#define mclr(x,sz) mset(x,0,sz)
bool is_pri(const int& x) {
	for(int i=2; i*i <= x; ++i) if(x%i==0) return false;
	return true;
}
int main () {
	string s;
	cin >> s;
	int n = s.sz;
	map<char, int> cht;
	rep(i,n) cht[s[i]]++;
	char chart;
	int chcnt=0;
	vector<pair<int, char> > vp;
	repeach(itr, cht) vp.pb(mp(itr->second, itr->first));
	sort(all(vp), greater<pair<int, char> >());
	string ss;
	repeach(itr, vp) while(itr->first--) ss+= itr->second;

	int front=0, rear = ss.sz;
	rep(i, n) {
		int x = i+1;
		if(x==1) s[i] = ss[--rear];
		else {
			if(x*2 <= n || !is_pri(x)) s[i] = ss[front++];
			else s[i] = ss[--rear];
		}
	}
	if(front > 0 && ss[front - 1] != ss[0]) cout << "NO";
	else {
		cout << "YES" << endl;
		cout << s << endl;
	}
	return 0;
}


#include<iostream>
#include<string>
using namespace std;
int B[26],ans;
bool K[1010];
string A;
int main()
{
	//freopen("input.txt","rb",stdin);
	//freopen("output.txt","wb",stdout);
	cin>>A;
	int n=A.length();
	for(int i=0;i<n;++i)B[A[i]-'a']++;
	for(int i=2;i<=n;++i)
	{
		int j;
		for(j=2;i%j!=0&&i*j<=n;++j)K[i*j]=1;
		if(i*j<=n)K[i*j]=1;
	}
	ans=n-1;
	for(int i=n/2+1;i<=n;++i)if(!K[i])ans--;
	for(int i=2;i<=n/2;++i)K[i]=1;
	for(int i=0,j,k=0;i<26;++i)if(B[i]>=ans)
	{
		cout<<"YES"<<endl;
		for(j=1;j<=n;++j)if(K[j])B[i]--,A[j-1]=i+'a';
		for(j=1;j<=n;++j)if(!K[j])
		{
			for(;!B[k];k++);
			B[k]--;
			A[j-1]=k+'a';
		}
		cout<<A<<endl;
		return 0;
	}
	cout<<"NO"<<endl;
	return 0;
}


#include<iostream>
#include<string>
using namespace std;
int B[26],ans;
bool K[1010];
string A;
int main()
{
	//freopen("input.txt","rb",stdin);
	//freopen("output.txt","wb",stdout);
	cin>>A;
	int n=A.length();
	for(int i=0;i<n;++i)B[A[i]-'a']++;
	for(int i=2;i<=n;++i)
	{
		int j;
		for(j=2;i%j!=0;++j)K[i*j]=1;
		K[i*j]=1;
	}
	ans=n-1;
	for(int i=n/2+1;i<=n;++i)if(!K[i])ans--;
	for(int i=0,j,k=0;i<26;++i)if(B[i]>=ans)
	{
		for(j=1;j<=n;++j)if(K[j])B[i]--,A[j-1]=i+'a';
		for(j=1;j<=n;++j)if(!K[j])
		{
			for(;!B[k];k++);
			B[k]--;
			A[j-1]=k+'a';
		}
		cout<<A<<endl;
		return 0;
	}
	cout<<"NO"<<endl;
	return 0;
}


#include<iostream>
#include<string>
using namespace std;
int B[26],ans;
bool K[1010];
string A;
int main()
{
	//freopen("input.txt","rb",stdin);
	//freopen("output.txt","wb",stdout);
	cin>>A;
	int n=A.length();
	for(int i=0;i<n;++i)B[A[i]-'a']++;
	for(int i=2;i<=n;++i)
	{
		int j;
		for(j=2;i%j!=0;++j)K[i*j]=1;
		K[i*j]=1;
	}
	ans=n-1;
	for(int i=n/2+1;i<=n;++i)if(!K[i])ans--;
	for(int i=0,j,k=0;i<26;++i)if(B[i]>=ans)
	{
		cout<<"YES"<<endl;
		for(j=1;j<=n;++j)if(K[j])B[i]--,A[j-1]=i+'a';
		for(j=1;j<=n;++j)if(!K[j])
		{
			for(;!B[k];k++);
			B[k]--;
			A[j-1]=k+'a';
		}
		cout<<A<<endl;
		return 0;
	}
	cout<<"NO"<<endl;
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <vector>

using namespace std;

#define PB push_back
#define F first
#define S second

int rank[1100], father[1100], cnt[1100];
int prime[1100];

int get_comp(int a){
	if(father[a] == a) return a;
	return get_comp(father[a]);
}
int get_cnt(int a) {
	return cnt[get_comp(a)];
}

void join(int a, int b){
//	cout << "Join "<< a << " " << b << endl;
	int ca = get_comp(a), cb = get_comp(b);
	if(ca == cb) return;
//	cout << "Unio "<< ca << " " << cb << endl;

	if(rank[ca] < rank[cb]) {
		father[ca] = cb;
		cnt[cb] += cnt[ca];
	} else {
		father[cb] = ca;
		cnt[ca] += cnt[cb];
	}
	if(rank[ca] == rank[cb]) rank[ca] ++;
}
int main () {
	string s;
	cin >> s;
	int n = s.size();

	for(int i=0 ; i<1100 ; i++) father[i] = i;
	for(int i=0 ; i<1100 ; i++) cnt[i] = 1;
	for(int i=0 ; i<1100 ; i++) rank[i] = 0;
	for(int i=2 ; i<1100 ; i++) prime[i] = true;
	prime[0] = false;
	prime[1] = false;

	for(int i=4 ; i<=n ; i+=2) {
		prime[i] = false;
		join(2, i);
	}

	for(int i=3 ; i <= n+1 ; i+=2) if(prime[i]){
		for(int j=i+i ; j<=n ; j+=i) {
			prime[j] = false;
			join(i, j);
		}
	}

	int f[26];
	vector<pair<int,char> > ff;
	for(int i=0 ; i<26 ; i++) f[i] = 0;
	for(int i=0 ; i<s.size() ; i++) f[s[i]-'a']++;
	for(int i=0 ; i<26 ; i++) if(f[i] != 0)ff.PB(pair<int,char> (f[i], 'a'+i));
	sort(ff.rbegin(), ff.rend());

	vector<pair<int,int> > cant;
	for(int i=1 ; i<= n ; i++) if(get_comp(i) == i){
		cant.push_back(pair<int,int> ( get_cnt(i), i));
	}

	bool valid = true;
	sort(cant.rbegin(), cant.rend());

/*	for(int i=0 ; i<cant.size() ; i++) cout << cant[i].F << " " << cant[i].S << endl;
	cout << endl;
	for(int i=0 ; i<ff.size() ; i++) cout << ff[i].F << " " << ff[i].S << endl;
	cout << endl;
*/
	map<int,char> asig;
	for(int i=0 ; i<cant. size() && valid; i++) {
		if(ff.size() == 0 || cant[i].F > ff[0].F) {
			valid = false;
			break;
		}

		asig[cant[i].S]  = ff[0].S;
		ff[0].F -= cant[i].F;
		if(ff[0].F == 0) ff.erase(ff.begin());
		sort(ff.rbegin(), ff.rend());
	}

	string ret(n, ' ');
	if(!valid) cout << "NO" << endl;
	else {
		for(int i=1 ; i<=n ; i++) {
			int cm = get_comp(i);
			ret[i-1] = asig[cm];
		}
		cout << "YES" << endl;
		cout << ret << endl;
	}

	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <vector>

using namespace std;

#define PB push_back
#define F first
#define S second

int rank[1100], father[1100], cnt[1100];
int prime[1100];

int get_comp(int a){
	if(father[a] == a) return a;
	return get_comp(father[a]);
}
int join(int a, int b){
	int ca = get_comp(a), cb = get_comp(b);
	if(rank[ca] < rank[cb]) {
		father[ca] = cb;
		cnt[cb] ++;
	} else {
		father[cb] = ca;
		cnt[ca]++;
	}
	if(rank[ca] == rank[cb]) rank[ca] ++;
}
int get_cnt(int a) {
	return cnt[get_comp(a)];
}
int main () {
	string s;
	cin >> s;
	int n = s.size();

	for(int i=0 ; i<1100 ; i++) father[i] = i;
	for(int i=0 ; i<1100 ; i++) cnt[i] = 1;
	for(int i=0 ; i<1100 ; i++) rank[i] = 0;
	for(int i=2 ; i<1100 ; i++) prime[i] = true;
	prime[0] = false;
	prime[1] = false;

	for(int i=4 ; i<=n ; i+=2) {
		prime[i] = false;
		join(2, i);
	}

	for(int i=3 ; i <= n+1 ; i+=2) if(prime[i]){
		for(int j=i+i ; j<=n ; j+=i) {
			prime[j] = false;
			join(i, j);
		}
	}

	int f[26];
	vector<pair<int,char> > ff;
	for(int i=0 ; i<26 ; i++) f[i] = 0;
	for(int i=0 ; i<s.size() ; i++) f[s[i]-'a']++;
	for(int i=0 ; i<26 ; i++) if(f[i] != 0)ff.PB(pair<int,char> (f[i], 'a'+i));
	sort(ff.rbegin(), ff.rend());

	vector<pair<int,int> > cant;
	for(int i=1 ; i<= n ; i++) if(get_comp(i) == i){
		cant.push_back(pair<int,int> ( get_cnt(i), i));
	}

	bool valid = true;
	sort(cant.rbegin(), cant.rend());

//	for(int i=0 ; i<cant.size() ; i++) cout << cant[i].F << " " << cant[i].S << endl;
//	cout << endl;
//	for(int i=0 ; i<ff.size() ; i++) cout << ff[i].F << " " << ff[i].S << endl;
//	cout << endl;

	map<int,char> asig;
	for(int i=0 ; i<cant. size() && valid; i++) {
		if(ff.size() == 0 || cant[i].F > ff[0].F) {
			valid = false;
			break;
		}

		asig[cant[i].S]  = ff[0].S;
		ff[0].F -= cant[i].F;
		if(ff[0].F == 0) ff.erase(ff.begin());
		sort(ff.rbegin(), ff.rend());
	}

	string ret(n, ' ');
	if(!valid) cout << "NO" << endl;
	else {
		for(int i=1 ; i<=n ; i++) {
			int cm = get_comp(i);
			ret[i-1] = asig[cm];
		}
		cout << "YES" << endl;
		cout << ret << endl;
	}

	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <vector>

using namespace std;

#define PB push_back
#define F first
#define S second

int main () {
	string s;
	cin >> s;
	int n = s.size();
	if(n <= 2) {
		cout << "YES" << endl << s << endl;
		return 0;
	}

	int f[26];
	for(int i=0 ; i<26 ; i++) f[i] = 0;
	for(int i=0 ; i<s.size() ; i++) f[s[i]-'a']++;

	char c;
	int cnt = 0;
	for(int i=0 ; i<26 ; i++) if(cnt < f[i]) {
		cnt = f[i], c = 'a'+i;
	}

	int cnt2 = 0;
	for(int i=2 ; i<= n ; i++) if(i%2==0 || i*i <= n) cnt2++;

	if(cnt2 > cnt) {
		cout << "NO" << endl;
		return 0;
	}
	string ret(n, ' ');

	for(int i=2 ; i<= n ; i++) if(i%2==0 || i*i <= n) ret[i-1] = c;
	f[c-'a'] -= cnt2;
	vector<char> asig;
	for(int i=0 ; i<26 ; i++) for(int j=0 ; j<f[i] ; j++) asig.PB('a'+i);
	ret[0] = asig[0];

	int next = 1;
	for(int i=3 ; i<=n ; i+=2) if(i*i > n)ret[i-1] = asig[next++];

	cout << "YES" << endl << ret << endl;
	return 0;
}