import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
import java.util.TreeSet;

/**
 *
 *
 * @author pttrung
 */
public class A {

    public static int Mod;
    public static int[] dp;
    public static int min;

    public static void main(String[] args) throws FileNotFoundException, IOException {

        Scanner in = new Scanner();
        //  PrintWriter out = new PrintWriter(new FileOutputStream(new File("output.txt")));
        PrintWriter out = new PrintWriter(System.out);
        String line = in.next();
        int n = line.length();
        HashMap<Character, Integer> m = new HashMap();
        for (int i = 0; i < n; i++) {
            char c = line.charAt(i);
            if (!m.containsKey(c)) {
                m.put(c, 0);
            }
            m.put(c, m.get(c) + 1);
        }

        boolean[] p = new boolean[n + 1];
        ArrayList<Integer> list = new ArrayList();
        for (int i = 2; i < p.length; i++) {
            if (!p[i]) {
                list.add(i);
                for (int j = i + i; j < p.length; j += i) {
                    p[j] = true;
                }
            }
        }
        boolean[][] map = new boolean[n][n];

        for (int i : list) {
            for (int j = 1; j <= n / i; j++) {
                if (j * i <= n) {
                    map[i - 1][j * i - 1] = true;
                    map[j * i - 1][i - 1] = true;
                }
            }
        }
        int[] check = new int[n];
        Arrays.fill(check, -1);
        ArrayList<Integer> num = new ArrayList();
        int comp = 0;
        for (int i = 0; i < n; i++) {
            if (check[i] == -1) {

                int val = dfs(i, comp, map, check);
                num.add(val);
                comp++;
            }
        }
        int[] match = new int[comp];
        ArrayList<Entry> q1 = new ArrayList();
        PriorityQueue<Entry> q2 = new PriorityQueue();

        for (char c : m.keySet()) {
            q1.add(new Entry(c - 'a', m.get(c)));
        }
        int index = 0;
        for (int val : num) {
            q2.add(new Entry(index++, val));
        }
        boolean found = true;
        while (!q2.isEmpty() && found) {
            Entry a = q2.poll();
            Entry b = q2.peek();
            found = false;
            for(Entry e : q1){
                if(e.num >= a.num){
                    if(e.num == a.num){
                        q1.remove(e);
                        found = true;
                        match[a.c] = e.c;
                        break;
                    }else if(b != null && b.num + a.num <= e.num){
                        found = true;
                        e.num -= a.num;
                        match[a.c] = e.c;
                        break;
                    }
                }
            }

        }
        if(!found){
            out.println("NO");
        }else{
            out.println("YES");
            for(int i = 0; i < n; i++){
                out.print((char)(match[check[i]] + 'a'));
            }
        }
        out.close();
    }

    public static class Entry implements Comparable<Entry> {

        int c;
        int num;

        public Entry(int c, int num) {
            this.c = c;
            this.num = num;
        }

        @Override
        public int compareTo(Entry o) {
            if (num != o.num) {
                return num - o.num;
            }
            return c - o.c;
        }
    }

    public static int dfs(int index, int comp, boolean[][] map, int[] check) {
        int result = 1;
        check[index] = comp;
        for (int i = 0; i < map.length; i++) {
            if (check[i] == -1 && map[index][i]) {
                result += dfs(i, comp, map, check);
            }
        }
        return result;
    }

    public static int[][] powSquareMatrix(int[][] A, long p) {
        int[][] unit = new int[A.length][A.length];
        for (int i = 0; i < unit.length; i++) {
            unit[i][i] = 1;
        }
        if (p == 0) {
            return unit;
        }
        int[][] val = powSquareMatrix(A, p / 2);
        if (p % 2 == 0) {
            return mulMatrix(val, val);
        } else {
            return mulMatrix(A, mulMatrix(val, val));
        }

    }

    public static int[][] mulMatrix(int[][] A, int[][] B) {
        int[][] result = new int[A.length][B[0].length];
        for (int i = 0; i < result.length; i++) {
            for (int j = 0; j < result[0].length; j++) {
                long temp = 0;
                for (int k = 0; k < A[0].length; k++) {

                    temp += ((long) A[i][k] * B[k][j] % Mod);
                    temp %= Mod;
                }
                temp %= Mod;
                result[i][j] = (int) temp;
            }
        }

        return result;
    }

    static double dist(Point a, Point b) {
        long total = (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
        return Math.sqrt(total);
    }

    static class Point implements Comparable<Point> {

        int x, y;

        public Point(int x, int y) {
            this.x = x;
            this.y = y;

        }

        @Override
        public int compareTo(Point o) {
            if (x != o.x) {
                return x - o.x;
            }
            return y - o.y;
        }
    }

    public static boolean nextPer(int[] data) {
        int i = data.length - 1;
        while (i > 0 && data[i] < data[i - 1]) {
            i--;
        }
        if (i == 0) {
            return false;
        }
        int j = data.length - 1;
        while (data[j] < data[i - 1]) {
            j--;
        }
        int temp = data[i - 1];
        data[i - 1] = data[j];
        data[j] = temp;
        Arrays.sort(data, i, data.length);
        return true;
    }

    static class FT {

        int[] data;

        FT(int n) {
            data = new int[n];
        }

        void update(int index, int val) {
            // System.out.println("UPDATE INDEX " + index);
            while (index < data.length) {
                data[index] += val;
                index += index & (-index);

                //    System.out.println("NEXT " +index);
            }
        }

        int get(int index) {
            //  System.out.println("GET INDEX " + index);
            int result = 0;
            while (index > 0) {
                result += data[index];
                index -= index & (-index);
                // System.out.println("BACK " + index);
            }
            return result;
        }
    }

    static int gcd(int a, int b) {
        if (b == 0) {
            return a;
        } else {
            return gcd(b, a % b);
        }
    }

    static int pow(int a, int b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        int val = pow(a, b / 2);
        if (b % 2 == 0) {

            return val * val;
        } else {
            return val * val * a;
        }
    }

//    static Point intersect(Point a, Point b, Point c) {
//        double D = cross(a, b);
//        if (D != 0) {
//            return new Point(cross(c, b) / D, cross(a, c) / D);
//        }
//        return null;
//    }
//
//    static Point convert(Point a, double angle) {
//        double x = a.x * cos(angle) - a.y * sin(angle);
//        double y = a.x * sin(angle) + a.y * cos(angle);
//        return new Point(x, y);
//    }
//    static Point minus(Point a, Point b) {
//        return new Point(a.x - b.x, a.y - b.y);
//    }
//
//    static Point add(Point a, Point b) {
//        return new Point(a.x + b.x, a.y + b.y);
//    }
//
//    static double cross(Point a, Point b) {
//        return a.x * b.y - a.y * b.x;
//
//
//    }
//
//    static class Point {
//
//        int x, y;
//
//        Point(int x, int y) {
//            this.x = x;
//            this.y = y;
//        }
//
//        @Override
//        public String toString() {
//            return "Point: " + x + " " + y;
//        }
//    }
    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            //System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //br = new BufferedReader(new FileReader(new File("A-large-practice.in")));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
import java.util.TreeSet;

/**
 *
 *
 * @author pttrung
 */
public class A {

    public static int Mod;
    public static int[] dp;
    public static int min;

    public static void main(String[] args) throws FileNotFoundException, IOException {

        Scanner in = new Scanner();
        //  PrintWriter out = new PrintWriter(new FileOutputStream(new File("output.txt")));
        PrintWriter out = new PrintWriter(System.out);
        String line = in.next();
        int n = line.length();
        HashMap<Character, Integer> m = new HashMap();
        for (int i = 0; i < n; i++) {
            char c = line.charAt(i);
            if (!m.containsKey(c)) {
                m.put(c, 0);
            }
            m.put(c, m.get(c) + 1);
        }

        boolean[] p = new boolean[n + 1];
        ArrayList<Integer> list = new ArrayList();
        for (int i = 2; i < p.length; i++) {
            if (!p[i]) {
                list.add(i);
                for (int j = i + i; j < p.length; j += i) {
                    p[j] = true;
                }
            }
        }
        boolean[][] map = new boolean[n][n];

        for (int i : list) {
            for (int j = 1; j <= n / i; j++) {
                if (j * i <= n) {
                    map[i - 1][j * i - 1] = true;
                    map[j * i - 1][i - 1] = true;
                }
            }
        }
        int[] check = new int[n];
        Arrays.fill(check, -1);
        ArrayList<Integer> num = new ArrayList();
        int comp = 0;
        for (int i = 0; i < n; i++) {
            if (check[i] == -1) {

                int val = dfs(i, comp, map, check);
                num.add(val);
                comp++;
            }
        }
      //  System.out.println(num);
        int[] match = new int[comp];
        ArrayList<Entry> q1 = new ArrayList();

        PriorityQueue<Entry> q2 = new PriorityQueue();

        for (char c : m.keySet()) {
            q1.add(new Entry(c - 'a', m.get(c)));
        }

        int index = 0;
        for (int val : num) {
            q2.add(new Entry(index++, val));
        }
        boolean found = true;
        while (!q2.isEmpty() && found) {
            Entry a = q2.poll();
            Entry b = q2.peek();
          //  System.out.println(a.c + " " + a.num);
            found = false;
            for(Entry e : q1){
                if(e.num >= a.num){
                    if(e.num == a.num){
                        q1.remove(e);
                        found = true;
                        match[a.c] = e.c;
                        break;
                    }else if(b != null && b.num + a.num <= e.num){
                        found = true;
                        e.num -= a.num;
                        match[a.c] = e.c;
                        break;
                    }
                }
            }
            Collections.sort(q1);

        }
        if(!found){
            out.println("NO");
        }else{
            out.println("YES");
            for(int i = 0; i < n; i++){
                out.print((char)(match[check[i]] + 'a'));
            }
        }
        out.close();
    }

    public static class Entry implements Comparable<Entry> {

        int c;
        int num;

        public Entry(int c, int num) {
            this.c = c;
            this.num = num;
        }

        @Override
        public int compareTo(Entry o) {
            if (num != o.num) {
                return num - o.num;
            }
            return c - o.c;
        }
    }

    public static int dfs(int index, int comp, boolean[][] map, int[] check) {
        int result = 1;
        check[index] = comp;
        for (int i = 0; i < map.length; i++) {
            if (check[i] == -1 && map[index][i]) {
                result += dfs(i, comp, map, check);
            }
        }
        return result;
    }

    public static int[][] powSquareMatrix(int[][] A, long p) {
        int[][] unit = new int[A.length][A.length];
        for (int i = 0; i < unit.length; i++) {
            unit[i][i] = 1;
        }
        if (p == 0) {
            return unit;
        }
        int[][] val = powSquareMatrix(A, p / 2);
        if (p % 2 == 0) {
            return mulMatrix(val, val);
        } else {
            return mulMatrix(A, mulMatrix(val, val));
        }

    }

    public static int[][] mulMatrix(int[][] A, int[][] B) {
        int[][] result = new int[A.length][B[0].length];
        for (int i = 0; i < result.length; i++) {
            for (int j = 0; j < result[0].length; j++) {
                long temp = 0;
                for (int k = 0; k < A[0].length; k++) {

                    temp += ((long) A[i][k] * B[k][j] % Mod);
                    temp %= Mod;
                }
                temp %= Mod;
                result[i][j] = (int) temp;
            }
        }

        return result;
    }

    static double dist(Point a, Point b) {
        long total = (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
        return Math.sqrt(total);
    }

    static class Point implements Comparable<Point> {

        int x, y;

        public Point(int x, int y) {
            this.x = x;
            this.y = y;

        }

        @Override
        public int compareTo(Point o) {
            if (x != o.x) {
                return x - o.x;
            }
            return y - o.y;
        }
    }

    public static boolean nextPer(int[] data) {
        int i = data.length - 1;
        while (i > 0 && data[i] < data[i - 1]) {
            i--;
        }
        if (i == 0) {
            return false;
        }
        int j = data.length - 1;
        while (data[j] < data[i - 1]) {
            j--;
        }
        int temp = data[i - 1];
        data[i - 1] = data[j];
        data[j] = temp;
        Arrays.sort(data, i, data.length);
        return true;
    }

    static class FT {

        int[] data;

        FT(int n) {
            data = new int[n];
        }

        void update(int index, int val) {
            // System.out.println("UPDATE INDEX " + index);
            while (index < data.length) {
                data[index] += val;
                index += index & (-index);

                //    System.out.println("NEXT " +index);
            }
        }

        int get(int index) {
            //  System.out.println("GET INDEX " + index);
            int result = 0;
            while (index > 0) {
                result += data[index];
                index -= index & (-index);
                // System.out.println("BACK " + index);
            }
            return result;
        }
    }

    static int gcd(int a, int b) {
        if (b == 0) {
            return a;
        } else {
            return gcd(b, a % b);
        }
    }

    static int pow(int a, int b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        int val = pow(a, b / 2);
        if (b % 2 == 0) {

            return val * val;
        } else {
            return val * val * a;
        }
    }

//    static Point intersect(Point a, Point b, Point c) {
//        double D = cross(a, b);
//        if (D != 0) {
//            return new Point(cross(c, b) / D, cross(a, c) / D);
//        }
//        return null;
//    }
//
//    static Point convert(Point a, double angle) {
//        double x = a.x * cos(angle) - a.y * sin(angle);
//        double y = a.x * sin(angle) + a.y * cos(angle);
//        return new Point(x, y);
//    }
//    static Point minus(Point a, Point b) {
//        return new Point(a.x - b.x, a.y - b.y);
//    }
//
//    static Point add(Point a, Point b) {
//        return new Point(a.x + b.x, a.y + b.y);
//    }
//
//    static double cross(Point a, Point b) {
//        return a.x * b.y - a.y * b.x;
//
//
//    }
//
//    static class Point {
//
//        int x, y;
//
//        Point(int x, int y) {
//            this.x = x;
//            this.y = y;
//        }
//
//        @Override
//        public String toString() {
//            return "Point: " + x + " " + y;
//        }
//    }
    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            //System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //br = new BufferedReader(new FileReader(new File("A-large-practice.in")));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}


    import java.util.*;
    import java.io.*;

    public class Codeforces {

        public static void main(String[] args) throws IOException {
            Reader.init(System.in);
            String s = Reader.next();
            char ans[] = new char[s.length() + 1], ch = 0;
            int freq[] = new int[26];
            int max = 0;
            boolean isP[] = new boolean[s.length() + 1];

            for(int i = 0; i < s.length(); i++){
                int x = s.charAt(i) - 97;
                freq[x]++;

                if(freq[x]  > freq[max]){
                    max = x;
                    ch = s.charAt(i);
                }
            }

            for(int i = 2; i * i <= s.length(); i++){
                if(!isP[i]){

                    if(i * 2 > s.length())
                        break;

                    for(int j = i ; j <= s.length(); j += i){
                        isP[j] = true;
                    }
                }
            }

            for(int i = 2; i <= s.length(); i++)
                if(isP[i]){
                    if(freq[max] == 0){
                        System.out.println("NO");
                    }

                    ans[i] = ch;
                    freq[max]--;
                }

            int j = 0;
            for(int i = 1; i <= s.length(); i++){
                if(isP[i])
                    continue;

                while(j < 26 && freq[j] == 0)
                    j++;

                ans[i] = (char)(j+97);
                freq[j]--;
            }

            System.out.println("YES");
            for(int i = 1; i < ans.length; i++)
                System.out.print(ans[i]);

        }
    }

    class  Edge implements Comparable<Edge>{

        int to;
        int cost;

        Edge(int a, int b){
            to = a;
            cost = b;
        }

        @Override
        public int compareTo(Edge t) {
            return cost - t.cost;
        }
    }

    class Reader {

        static BufferedReader reader;
        static StringTokenizer tokenizer;

        public static int pars(String x) {
            int num = 0;
            int i = 0;
            if (x.charAt(0) == '-') {
                i = 1;
            }
            for (; i < x.length(); i++) {
                num = num * 10 + (x.charAt(i) - '0');
            }

            if (x.charAt(0) == '-') {
                return -num;
            }

            return num;
        }

        static void init(InputStream input) {
            reader = new BufferedReader(
                    new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        static void init(FileReader input) {
            reader = new BufferedReader(input);
            tokenizer = new StringTokenizer("");
        }

        static String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(
                        reader.readLine());
            }
            return tokenizer.nextToken();
        }

        static int nextInt() throws IOException {
            return pars(next());
        }

        static long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        static double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
    }


    import java.util.*;
    import java.io.*;

    public class Codeforces {

        public static void main(String[] args) throws IOException {
            Reader.init(System.in);
            String s = Reader.next();
            char ans[] = new char[s.length() + 1], ch = 0;
            int freq[] = new int[26];
            int max = 0;
            boolean isP[] = new boolean[s.length() + 1];

            for(int i = 0; i < s.length(); i++){
                int x = s.charAt(i) - 97;
                freq[x]++;

                if(freq[x]  > freq[max]){
                    max = x;
                    ch = s.charAt(i);
                }
            }

            for(int i = 2; i * i <= s.length(); i++){
                if(!isP[i]){

                    if(i * 2 > s.length())
                        break;

                    for(int j = i ; j <= s.length(); j += i){
                        isP[j] = true;
                    }
                }
            }

            for(int i = 2; i <= s.length(); i++)
                if(isP[i]){
                    if(freq[max] == 0){
                        System.out.println("NO");
                        return;
                    }

                    ans[i] = ch;
                    freq[max]--;
                }

            int j = 0;
            for(int i = 1; i <= s.length(); i++){
                if(isP[i])
                    continue;

                while(j < 26 && freq[j] == 0)
                    j++;

                ans[i] = (char)(j+97);
                freq[j]--;
            }

            System.out.println("YES");
            for(int i = 1; i < ans.length; i++)
                System.out.print(ans[i]);

        }
    }

    class  Edge implements Comparable<Edge>{

        int to;
        int cost;

        Edge(int a, int b){
            to = a;
            cost = b;
        }

        @Override
        public int compareTo(Edge t) {
            return cost - t.cost;
        }
    }

    class Reader {

        static BufferedReader reader;
        static StringTokenizer tokenizer;

        public static int pars(String x) {
            int num = 0;
            int i = 0;
            if (x.charAt(0) == '-') {
                i = 1;
            }
            for (; i < x.length(); i++) {
                num = num * 10 + (x.charAt(i) - '0');
            }

            if (x.charAt(0) == '-') {
                return -num;
            }

            return num;
        }

        static void init(InputStream input) {
            reader = new BufferedReader(
                    new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        static void init(FileReader input) {
            reader = new BufferedReader(input);
            tokenizer = new StringTokenizer("");
        }

        static String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(
                        reader.readLine());
            }
            return tokenizer.nextToken();
        }

        static int nextInt() throws IOException {
            return pars(next());
        }

        static long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        static double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
    }


    import java.util.*;
    import java.io.*;

    public class Codeforces {

        public static void main(String[] args) throws IOException {
            Reader.init(System.in);
            String s = Reader.next();
            char ans[] = new char[s.length() + 1], ch = 0;
            int freq[] = new int[26];
            int max = -1;
            boolean isP[] = new boolean[s.length() + 1];

            for(int i = 0; i < s.length(); i++){
                int x = s.charAt(i) - 97;
                freq[x]++;

                if(freq[x]  > freq[max]){
                    max = x;
                    ch = s.charAt(i);
                }
            }

            for(int i = 2; i < s.length(); i++){
                if(!isP[i]){

                    if(i * 2 > s.length())
                        break;

                    for(int j = i ; j <= s.length(); j += i){
                        isP[j] = true;
                    }
                }
            }

            for(int i = 2; i <= s.length(); i++)
                if(isP[i]){
                    if(freq[max] == 0){
                        System.out.println("NO");
                        return;
                    }

                    ans[i] = ch;
                    freq[max]--;
                }

            int j = 0;
            for(int i = 1; i <= s.length(); i++){
                if(isP[i])
                    continue;

                while(j < 26 && freq[j] == 0)
                    j++;

                ans[i] = (char)(j+97);
                freq[j]--;
            }

            System.out.println("YES");
            for(int i = 1; i < ans.length; i++)
                System.out.print(ans[i]);

        }
    }

    class  Edge implements Comparable<Edge>{

        int to;
        int cost;

        Edge(int a, int b){
            to = a;
            cost = b;
        }

        @Override
        public int compareTo(Edge t) {
            return cost - t.cost;
        }
    }

    class Reader {

        static BufferedReader reader;
        static StringTokenizer tokenizer;

        public static int pars(String x) {
            int num = 0;
            int i = 0;
            if (x.charAt(0) == '-') {
                i = 1;
            }
            for (; i < x.length(); i++) {
                num = num * 10 + (x.charAt(i) - '0');
            }

            if (x.charAt(0) == '-') {
                return -num;
            }

            return num;
        }

        static void init(InputStream input) {
            reader = new BufferedReader(
                    new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        static void init(FileReader input) {
            reader = new BufferedReader(input);
            tokenizer = new StringTokenizer("");
        }

        static String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(
                        reader.readLine());
            }
            return tokenizer.nextToken();
        }

        static int nextInt() throws IOException {
            return pars(next());
        }

        static long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        static double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
    }


    import java.util.*;
    import java.io.*;

    public class Codeforces {

        public static void main(String[] args) throws IOException {
            Reader.init(System.in);
            String s = Reader.next();
            char ans[] = new char[s.length() + 1], ch = 0;
            int freq[] = new int[26];
            int max = 0;
            boolean isP[] = new boolean[s.length() + 1];

            for(int i = 0; i < s.length(); i++){
                int x = s.charAt(i) - 97;
                freq[x]++;

                if(freq[x]  > freq[max]){
                    max = x;
                    ch = s.charAt(i);
                }
            }

            for(int i = 2; i < s.length(); i++){
                if(!isP[i]){

                    if(i * 2 > s.length())
                        break;

                    for(int j = i ; j <= s.length(); j += i){
                        isP[j] = true;
                    }
                }
            }

            for(int i = 2; i <= s.length(); i++)
                if(isP[i]){
                    if(freq[max] == 0){
                        System.out.println("NO");
                        return;
                    }

                    ans[i] = ch;
                    freq[max]--;
                }

            int j = 0;
            for(int i = 1; i <= s.length(); i++){
                if(isP[i])
                    continue;

                while(j < 26 && freq[j] == 0)
                    j++;

                ans[i] = (char)(j+97);
                freq[j]--;
            }

            System.out.println("YES");
            for(int i = 1; i < ans.length; i++)
                System.out.print(ans[i]);

        }
    }

    class  Edge implements Comparable<Edge>{

        int to;
        int cost;

        Edge(int a, int b){
            to = a;
            cost = b;
        }

        @Override
        public int compareTo(Edge t) {
            return cost - t.cost;
        }
    }

    class Reader {

        static BufferedReader reader;
        static StringTokenizer tokenizer;

        public static int pars(String x) {
            int num = 0;
            int i = 0;
            if (x.charAt(0) == '-') {
                i = 1;
            }
            for (; i < x.length(); i++) {
                num = num * 10 + (x.charAt(i) - '0');
            }

            if (x.charAt(0) == '-') {
                return -num;
            }

            return num;
        }

        static void init(InputStream input) {
            reader = new BufferedReader(
                    new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        static void init(FileReader input) {
            reader = new BufferedReader(input);
            tokenizer = new StringTokenizer("");
        }

        static String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(
                        reader.readLine());
            }
            return tokenizer.nextToken();
        }

        static int nextInt() throws IOException {
            return pars(next());
        }

        static long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        static double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
    }


    import java.util.*;
    import java.io.*;

    public class Codeforces {

        public static void main(String[] args) throws IOException {
            Reader.init(System.in);
            String s = Reader.next();
            char ans[] = new char[s.length() + 1], ch = 'a';
            int freq[] = new int[26];
            int max = 0;
            boolean isP[] = new boolean[s.length() + 1];

            for(int i = 0; i < s.length(); i++){
                int x = s.charAt(i) - 97;
                freq[x]++;

                if(freq[x]  > freq[max]){
                    max = x;
                    ch = s.charAt(i);
                }
            }

            for(int i = 2; i < s.length(); i++){
                if(!isP[i]){

                    if(i * 2 > s.length())
                        break;

                    for(int j = i ; j <= s.length(); j += i){
                        isP[j] = true;
                    }
                }
            }

            for(int i = 2; i <= s.length(); i++)
                if(isP[i]){
                    if(freq[max] == 0){
                        System.out.println("NO");
                        return;
                    }

                    ans[i] = ch;
                    freq[max]--;
                }

            int j = 0;
            for(int i = 1; i <= s.length(); i++){
                if(isP[i])
                    continue;

                while(j < 26 && freq[j] == 0)
                    j++;

                ans[i] = (char)(j+97);
                freq[j]--;
            }

            System.out.println("YES");
            for(int i = 1; i < ans.length; i++)
                System.out.print(ans[i]);

        }
    }

    class  Edge implements Comparable<Edge>{

        int to;
        int cost;

        Edge(int a, int b){
            to = a;
            cost = b;
        }

        @Override
        public int compareTo(Edge t) {
            return cost - t.cost;
        }
    }

    class Reader {

        static BufferedReader reader;
        static StringTokenizer tokenizer;

        public static int pars(String x) {
            int num = 0;
            int i = 0;
            if (x.charAt(0) == '-') {
                i = 1;
            }
            for (; i < x.length(); i++) {
                num = num * 10 + (x.charAt(i) - '0');
            }

            if (x.charAt(0) == '-') {
                return -num;
            }

            return num;
        }

        static void init(InputStream input) {
            reader = new BufferedReader(
                    new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        static void init(FileReader input) {
            reader = new BufferedReader(input);
            tokenizer = new StringTokenizer("");
        }

        static String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(
                        reader.readLine());
            }
            return tokenizer.nextToken();
        }

        static int nextInt() throws IOException {
            return pars(next());
        }

        static long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        static double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
    }


import java.io.*;
import java.util.*;
import java.math.*;
import java.text.*;

public class Main {
	private static final int MAXN = 1111;
	private static int[] fa = new int[ MAXN ];
	private static int[] cnt = new int[ MAXN ];
	private static int[] acnt = new int[ 88 ];

	private static int n ;
	private static String s;

	private static void init() {
		for(int i=0;i<n;++i) {
			fa[i] = i;
			cnt[i]=1;
		}
		Arrays.fill(acnt, 0, 88, 0);
	}
	private static int find(int x) {
		if( fa[x] == x ) return x;
		return fa[x] = find( fa[x] );
	}

	private static boolean isp(int n) {
		if(n==1)return false;
		for(int i=2;i*i<=n;++i) if(n%i == 0)
			return false;
		return true;
	}
	public static void main(String args[]) {
		Scanner cin = new Scanner(System.in);
		s = cin.next();
		n = s.length();
		init();
		for(int i=0;i<n;++i) {
			char c = s.charAt( i );
			++ acnt[ c-'a' ];
			if( isp(i+1)) {
				for(int j=i+1+i+1; j <= n; j += i + 1) {
					int f_a = find(i), f_b = find(j-1);
					if( f_a != f_b) {
						cnt[f_a] += cnt[f_b];
						fa[f_b] = f_a;
					}
				}
			}
		}
		char[] cc = s.toCharArray();

		boolean ok=true;
		while( true ) {
			int j=0;
			for(int i=0;i<n;++i) {
				int _ct = cnt[find(i)];
				if(_ct >  cnt[find(j)])
					j = i;
			}
			int k=0;
			for(int i=0;i<26;++i){
				if(acnt[i]>acnt[k])
					k=i;
			}
			if(acnt[k] == 0) break;
			//System.out.printf("%d %d\n", acnt[k], cnt[find(j)]);
			if( acnt[k] < cnt[find(j)]) {
				ok = false;
				break;
			}
			acnt[k] -= cnt[find(j)];
			cnt[find(j)] = 0;
			for(int i=0;i<n;++i) if(find(i) == find(j))
				cc[i] = (char)('a'+k);
		}
		if(!ok) System.out.println("NO");
		else {
			System.out.println("YES");
			for(int i=0;i<n;++i) System.out.print(cc[i]);
			System.out.println();
		}
    }
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define abdelrahman001 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
typedef long long ll;
using namespace std;
int main()
{
    abdelrahman001
    string s;
    vector<ll>p,v;
    cin >> s;
    ll n = s.size(),cnt =0;
    for(int i = 2;i<=n;i++)
    {
        bool prime = true;
        for(int j = 2;j<=sqrt(i);j++)
        {
            if(i%j == 0)
            {
                prime = false;
                break;
            }
        }
        if(prime)
            v.push_back(i);
    }
    for(int i = 0;i<v.size();i++)
        if(n/v[i] > 1)
        {
            p.push_back(v[i]);
            cnt+=n/v[i];
            for(int j = 0;j<i;j++)
                cnt-=(n/(v[i]*v[j]));
        }
    map<char,ll>mp;
    for(auto i:s)
        mp[i]++;
    char c;
    bool yes = false;
    vector<char>ans(n);
    vector<bool>chk(n);
    for(auto i:mp)
        if(i.second >= cnt)
            c= i.first,yes = true;
    if(!yes)
        return cout << "NO",0;
    if(cnt)
        mp[c]-=(cnt);
    for(auto i:p)
        for(int j = i-1,x = 1;x <= n/i;j+=i,x++)
            ans[j] = c,chk[j] = true;
    for(auto i:mp)
    {
        ll x = i.second;
        while(x--)
            for(int j = 0;j<n;j++)
                if(!chk[j])
                {
                    ans[j] = i.first;
                    chk[j] = true;
                    break;
                }
    }
    cout << "YES\n";
    for(auto i:ans)
        cout << i;
    return 0;
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define abdelrahman001 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
typedef long long ll;
using namespace std;
int main()
{
    abdelrahman001
    string s;
    vector<ll>p;
    cin >> s;
    ll n = s.size(),cnt =0;
    for(int i = 2;i<=n;i++)
    {
        bool prime = true;
        for(int j = 2;j<=sqrt(i);j++)
        {
            if(i%j == 0)
            {
                prime = false;
                break;
            }
        }
        if(prime && n/i > 1)
            p.push_back(i),cnt+=n/i;
    }
    map<char,ll>mp;
    for(auto i:s)
        mp[i]++;
    char c;
    bool yes = false;
    vector<char>ans(n);
    vector<bool>chk(n);
    for(auto i:mp)
        if(i.second >= cnt - p.size() + 1)
            c= i.first,yes = true;
    if(!yes)
        return cout << "NO",0;
    if(cnt)
        mp[c]-=(cnt - p.size() + 1);
    for(auto i:p)
        for(int j = i-1,x = 1;x <= n/i;j+=i,x++)
            ans[j] = c,chk[j] = true;
    for(auto i:mp)
    {
        ll x = i.second;
        while(x--)
            for(int j = 0;j<n;j++)
                if(!chk[j])
                {
                    ans[j] = i.first;
                    chk[j] = true;
                    break;
                }
    }
    cout << "YES\n";
    for(auto i:ans)
        cout << i;
    return 0;
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define abdelrahman001 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
typedef long long ll;
using namespace std;
int main()
{
    abdelrahman001
    string s;
    vector<ll>p;
    cin >> s;
    ll n = s.size(),cnt =0;
    for(int i = 2;i<=n;i++)
    {
        bool prime = true;
        for(int j = 2;j<=sqrt(i);j++)
        {
            if(i%j == 0)
            {
                prime = false;
                break;
            }
        }
        if(prime && n/i > 1)
            p.push_back(i),cnt+=n/i;
    }
    map<char,ll>mp;
    for(auto i:s)
        mp[i]++;
    char c;
    bool yes = false;
    vector<char>ans(n);
    vector<bool>chk(n);
    for(auto i:mp)
        if(i.second >= cnt - p.size() + 1)
            c= i.first,yes = true;
    if(!yes)
        return cout << "NO",0;
    mp[c]-=(cnt - p.size() + 1);
    for(auto i:p)
        for(int j = i-1,x = 1;x <= n/i;j+=i,x++)
            ans[j] = c,chk[j] = true;
    for(auto i:mp)
    {
        ll x = i.second;
        while(x--)
            for(int j = 0;j<n;j++)
                if(!chk[j])
                {
                    ans[j] = i.first;
                    chk[j] = true;
                    break;
                }
    }
    cout << "YES\n";
    for(auto i:ans)
        cout << i;
    return 0;
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define abdelrahman001 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
typedef long long ll;
using namespace std;
void pre(ll x)
{

}
int main()
{
    abdelrahman001
    string s;
    vector<ll>p;
    cin >> s;
    ll n = s.size();
    for(int i = 2;i<=n;i++)
    {
        bool prime = true;
        for(int j = 2;j<=sqrt(i);j++)
        {
            if(i%j == 0)
            {
                prime = false;
                break;
            }
        }
        if(prime)
            p.push_back(i);
    }
    map<char,ll>mp;
    for(auto i:s)
        mp[i]++;
    vector<char>ans(n);
    vector<bool>chk(n);
    char prev;
    ll lst;
    for(auto i:p)
    {
        bool yes = false;
        char c;
        if(i > 2 && n>=i*lst)
        {
            if(mp[prev] >= n/i)
            {
                yes = true;
                c = prev;
                mp[prev] -= n/i;
                prev = c;
                lst = i;
            }
        } else
        {
            for(auto &j:mp)
                if(j.second >= n/i)
                {
                    yes = true;
                    c = j.first;
                    j.second -= n/i;
                    break;
                }
        }
        if(!yes)
            return cout << "NO",0;
        for(int j = i-1,x = 1;x <= n/i;j+=i,x++)
        {
            if(chk[j])
                mp[c]++;
            ans[j] = c,chk[j] = true;
        }
    }
    for(auto i:mp)
    {
        ll x = i.second;
        while(x--)
            for(int j = 0;j<n;j++)
                if(!chk[j])
                {
                    ans[j] = i.first;
                    break;
                }
    }
    cout << "YES\n";
    for(auto i:ans)
        cout << i;
    return 0;
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define abdelrahman001 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
typedef long long ll;
using namespace std;
int main()
{
    abdelrahman001
    string s;
    vector<ll>p;
    cin >> s;
    ll n = s.size();
    for(int i = 2;i<=n;i++)
    {
        bool prime = true;
        for(int j = 2;j<=sqrt(i);j++)
        {
            if(i%j == 0)
            {
                prime = false;
                break;
            }
        }
        if(prime)
            p.push_back(i);
    }
    map<char,ll>mp;
    for(auto i:s)
        mp[i]++;
    vector<char>ans(n);
    vector<bool>chk(n);
    char prev;
    ll lst=1;
    for(auto i:p)
    {
        bool yes = false;
        char c;
        if(i > 2 && n>=i*lst)
        {
            if(mp[prev] >= n/i)
            {
                yes = true;
                c = prev;
                mp[prev] -= n/i;
            }
        } else
        {
            for(auto &j:mp)
                if(j.second >= n/i)
                {
                    yes = true;
                    c = j.first;
                    j.second -= n/i;
                    break;
                }
        }
        prev = c;
        lst = i;
        if(!yes)
            return cout << "NO",0;
        for(int j = i-1,x = 1;x <= n/i;j+=i,x++)
        {
            if(chk[j])
                mp[c]++;
            ans[j] = c,chk[j] = true;
        }
    }
    for(auto i:mp)
    {
        ll x = i.second;
        while(x--)
            for(int j = 0;j<n;j++)
                if(!chk[j])
                {
                    ans[j] = i.first;
                    break;
                }
    }
    cout << "YES\n";
    for(auto i:ans)
        cout << i;
    return 0;
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define abdelrahman001 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
typedef long long ll;
using namespace std;
int main()
{
    abdelrahman001
    string s;
    vector<ll>p,v;
    cin >> s;
    ll n = s.size(),cnt =0;
    for(int i = 2;i<=n;i++)
    {
        bool prime = true;
        for(int j = 2;j<=sqrt(i);j++)
        {
            if(i%j == 0)
            {
                prime = false;
                break;
            }
        }
        if(prime)
            v.push_back(i);
    }
    for(int i = 0;i<v.size();i++)
        if(n/v[i] > 1)
        {
            p.push_back(v[i]);
            cnt+=n/v[i];
            set<ll>st;
            for(int j = 0;j<i;j++)
                for(int k = v[i];k<=n;k+=v[i])
                    if(k%v[j] == 0)
                        st.insert(k);
            cnt-=st.size();
        }
    map<char,ll>mp;
    for(auto i:s)
        mp[i]++;
    char c;
    bool yes = false;
    vector<char>ans(n);
    vector<bool>chk(n);
    for(auto i:mp)
        if(i.second >= cnt)
            c= i.first,yes = true;
    if(!yes)
        return cout << "NO",0;
    if(cnt)
        mp[c]-=(cnt);
    for(auto i:p)
        for(int j = i-1,x = 1;x <= n/i;j+=i,x++)
            ans[j] = c,chk[j] = true;
    for(auto i:mp)
    {
        ll x = i.second;
        while(x--)
            for(int j = 0;j<n;j++)
                if(!chk[j])
                {
                    ans[j] = i.first;
                    chk[j] = true;
                    break;
                }
    }
    cout << "YES\n";
    for(auto i:ans)
        cout << i;
    return 0;
}


#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i = (a) ; i<b ; i++)
#define Set(a,b) memset(a,b,sizeof(a))
#define mp make_pair
#define pb push_back
#define all(v) (v.begin(), v.end())
typedef long long LL;
using namespace std;
LL MOD = 1e9+7;

bool p[1009];
__inline void sieve()
{
    FOR(i,2,1001)
    {
        if(!p[i])
            for(int j=i*i ; j<1001 ; j+=i)
                p[j]=1;
    }
}

int main()
{
    ios_base::sync_with_stdio(0);
   //// freopen("input.in", "r", stdin);

    string s;
    while(cin>>s)
    {
        pair<int,int> freq[30];
        FOR(i,0,26)
            freq[i] = mp(0,i);
        FOR(i,0,s.size())freq[s[i]-'a'].first++;
        sort(freq,freq+26);
        reverse(freq,freq+26);
        sieve();
        set<int>S;
        int n = s.size();
        for(int i=2 ; i<=s.size() ; i++)
        {
            if(!p[i])
            {
               int bef = S.size();
                for(int j=2 ; j<=s.size()/i ; j++)
                    S.insert(i*j);
                if(S.find(i*2)!=S.end())
                    S.insert(i);
            }

        }
        vector<char>res(s.size(),0);
        if(S.size()<=freq[0].first)
        {
            cout << "YES" <<endl;
            for (set<int>::iterator it = S.begin(); it != S.end(); ++it)
                res[(*it)-1] = (freq[0].second+'a'),--freq[0].first;
            int c=0;
            FOR(i,0,26)
            {
                while(c<s.size() && freq[i].first>0)
                {
                    if(!res[c])
                        res[c]=(freq[i].second+'a'),--freq[i].first;
                    ++c;
                }
            }
            FOR(i,0,s.size())
            cout << res[i] ;
            cout << "\n";
        }
        else
        {
            cout << "NO" <<endl;
        }
    }

    return 0;
}


#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i = (a) ; i<b ; i++)
#define Set(a,b) memset(a,b,sizeof(a))
#define mp make_pair
#define pb push_back
#define all(v) (v.begin(), v.end())
typedef long long LL;
using namespace std;
LL MOD = 1e9+7;

bool p[1009];
__inline void sieve()
{
    FOR(i,2,1001)
    {
        if(!p[i])
            for(int j=i*i ; j<1001 ; j+=i)
                p[j]=1;
    }
}

int main()
{
    ios_base::sync_with_stdio(0);
   //// freopen("input.in", "r", stdin);

    string s;
    while(cin>>s)
    {
        pair<int,int> freq[30];
        FOR(i,0,26)
            freq[i] = mp(0,i);
        FOR(i,0,s.size())freq[s[i]-'a'].first++;
        sort(freq,freq+26);
        reverse(freq,freq+26);
        sieve();
        set<int>S;
        for(int i=2 ; i<=s.size()/2 ; i++)
        {
            if(!p[i])
            {
               int bef = S.size();
                for(int j=2 ; j<=s.size()/i ; j++)
                    S.insert(i*j);
                int aft = S.size();
                if(aft>bef)
                    S.insert(i);
            }

        }
        vector<char>res(s.size(),0);
        if(S.size()<=freq[0].first)
        {
            cout << "YES" <<endl;
            for (set<int>::iterator it = S.begin(); it != S.end(); ++it)
                res[(*it)-1] = (freq[0].second+'a'),--freq[0].first;
            int c=0;
            FOR(i,0,26)
            {
                while(c<s.size() && freq[i].first>0)
                {
                    if(!res[c])res[c]=(freq[i].second+'a'),--freq[i].first;
                    ++c;
                }
            }
            FOR(i,0,s.size())
            cout << res[i] ;
            cout << "\n";
        }
        else
        {
            cout << "NO" <<endl;
        }
    }

    return 0;
}


#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i = (a) ; i<b ; i++)
#define Set(a,b) memset(a,b,sizeof(a))
#define mp make_pair
#define pb push_back
#define all(v) (v.begin(), v.end())
typedef long long LL;
using namespace std;
LL MOD = 1e9+7;

bool p[1009];
__inline void sieve()
{
    FOR(i,2,1001)
    {
        if(!p[i])
            for(int j=i*i ; j<1001 ; j+=i)
                p[j]=1;
    }
}

int main()
{
    ios_base::sync_with_stdio(0);
  ///  freopen("input.in", "r", stdin);

    string s;
    while(cin>>s)
    {
        pair<int,int> freq[30];
        FOR(i,0,26)
            freq[i] = mp(0,i);
        FOR(i,0,s.size())freq[s[i]-'a'].first++;
        sort(freq,freq+26);
        reverse(freq,freq+26);
        sieve();
        set<int>S;
        for(int i=2 ; i<=s.size() ; i++)
        {
            if(!p[i])
            {
               int bef = S.size();
                for(int j=2 ; j<=s.size()/i ; j++)
                    S.insert(i*j);
                int aft = S.size();
                if(aft>bef)
                    S.insert(i);
            }

        }
        vector<char>res(s.size(),0);
        if(S.size()<=freq[0].first)
        {
            cout << "YES" <<endl;
            for (set<int>::iterator it = S.begin(); it != S.end(); ++it)
                res[(*it)-1] = (freq[0].second+'a'),--freq[0].first;
            int c=0;
            FOR(i,0,26)
            {
                while(c<s.size() && freq[i].first>0)
                {
                    if(!res[c])
                        res[c]=(freq[i].second+'a'),--freq[i].first;
                    ++c;
                }
            }
            FOR(i,0,s.size())
            cout << res[i] ;
            cout << "\n";
        }
        else
        {
            cout << "NO" <<endl;
        }
    }

    return 0;
}


/* -*- coding: utf-8; tab-width: 4 -*- */

#include <cstdio>
#include <algorithm>

int
main()
{
	char c;
	int t[26] = {};
	int k, n(0), m(0);
	bool f[1001] = {};
	bool d[1001] = {};

	while ('-') {
		c = std::getchar();
		if (c == EOF || c == '\n') break;
		k = c - 'a';
		n++, t[k]++;
		if (t[m] < t[k]) m = k;
	}

//	std::printf("%d/%d\n", m, n);

	k = 1, d[1] = true;
	if (n < 4) ++k, d[2] = true;

	for (int i(3); i <= n; i += 2) {
		if (f[i]) continue;
		if (n < i * 2) ++k, d[i] = true;
		for (int j(i*i); j <= n; j += i) f[j] = true;
	}

	if (n - k <= t[m]) {
		std::puts("YES");
		t[m] -= n - k;
		k = 0;
		for (int i(1); i <= n; ++i) {
			c = 'a' + m;
			if (d[i]) {
				while (t[k] == 0) ++k;
				c = 'a' + k, t[k]--;
			}
			std::printf("%c", c);
		}
		std::puts("");
	}
	else {
		std::puts("NO");
	}

	return 0;
}


#include <cmath>
#include <ctime>
#include <iostream>
#include <string>
#include <vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<cctype>
#include <iomanip>
#include <string>
#include <sstream>
#include <functional>
#include <numeric>
#include <stack>
#include <climits>
#include <float.h>
#include<unordered_map>
#include <bitset>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define f(i,a,b) for(int i=a;i<b;i++)
#define F(i,a,b) for(int i=a;i>=    b;i--)
#define sz(a) ((int)a.size())
#define all(c) c.begin(), c.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
#define dbgs(x) cerr << (#x) << " --> " << (x) << ' '
#define dbg(x) cerr << (#x) << " --> " << (x) << endl

typedef long long ll;
typedef unsigned long long ull;
typedef pair <ll, ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pair<int, int> > vpii;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
typedef long double ld;

template <class T> const T& max(const T& a, const T&b, const T&c) { return max(a, max(b, c)); }

template <class T> const T& min(const T& a, const T&b, const T&c) { return min(a, min(b, c)); }

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

ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }

ll poww(ll a, ll b) {

	if (b == 0) return 1;

	ll tmp = poww(a, b / 2);

	return (b & 1 ? a * tmp * tmp : tmp * tmp);

}

ll sumOfDigs(string s) { ll sum = 0; for (int i = 0; i < s.length(); i++) sum += s[i] - '0'; return sum; }

ll sumOfDigs(ll n) { return (n < 10 ? n : n % 10 + sumOfDigs(n / 10)); }

string itos(ll i) { string s = ""; 	while (i) { s += char(i % 10 + '0'); i /= 10; } reverse(all(s));  return s; }

ll stoi(string &s) { ll tot = 0; for (int i = (int)s.length() - 1, j = 1; i >= 0; i--, j *= 10) { tot += j * (s[i] + '0'); }  return tot; }

int months[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

using namespace std;

#define PI acos((ld)-1.0)

void t(){

#ifndef online_judge
	freopen("test.txt", "r", stdin);
#endif
}

// printf("%.8lf\n", sum * 1.0 / n);  // precision setting

ll mod = 1000 * 1000 * 1000 + 7;;

ll modpower(ll x, ll y, ll p)
{

	x %= mod;

	if (!y) return 1;

	ll res = 1;

	if (y & 1) { res *= x;  res %= p; }

	ll z = modpower(x, y / 2, p);

	z %= p;

	z *= z;

	z %= mod;

	res *= z;

	res %= p;

	return res;

}

int a[1000], sieve[1000 * 1000], vis[1000 * 1000];

int main() {

	//t();

	string s;

	cin >> s;

	s.insert(0, 1, '0');

	int n = (int)s.length() - 1;

	int mx = 0;

	for (int i = 1; i <= n; i++)a[s[i] - 'a']++, mx = max(mx, a[s[i] - 'a']);

	for (int i = 1; i <= n; i++) s[i] = '*';

	//cout << "mx: " << mx << endl;

	sieve[1] = 1;

	for (int i = 1; i <= n; i++) {

		if (!sieve[i]) for (int j = 2 * i; j <= n; j += i) sieve[j] = 1;

	}

	int cnt = 0;

	for (int i = 2; i <= n / 2; i++) cnt++;

	for (int i = n / 2 + 1; i <= n; i++) if (sieve[i]) cnt++;

	if (mx < cnt) { return cout << "NO" << endl, 0;  }

	for (int i = 1; i <= n; i++) s[i] = '*';

	//cout << "s: " << s << endl;

	int pos = -1;

	for (int i = 0; i < 26; i++)  if (mx == a[i]) pos = i;

	//cout << "pos:  " << pos << endl;

	for (int i = 2; i <= n / 2; i++){ s[i] = char('a' + pos); a[pos]--;  }

	for (int i = n / 2 + 1; i <= n; i++) if (sieve[i]) s[i] = char('a' + pos), a[pos]--;

	//cout << "s: " << s << endl;

	cout << "YES" << endl;

	int j = 0;

	if (n > 1){
		while (!a[j]) j++;
		s[1] = char('a' + j);
		a[j]--;
	}
	//cout << "s: " << s << endl;

	for (int i = n / 2 + 1; i <= n; i++) {

		if (!sieve[i]) {

			while (!a[j]) j++;
			s[i] = char('a' + j);
			a[j]--;

		}

	}

	//cout << "s: " << s << endl;

	s = s.substr(1, n);
	cout << s << endl;

	return 0;

}


#include <cmath>
#include <ctime>
#include <iostream>
#include <string>
#include <vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<cctype>
#include <iomanip>
#include <string>
#include <sstream>
#include <functional>
#include <numeric>
#include <stack>
#include <climits>
#include <float.h>
#include<unordered_map>
#include <bitset>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define f(i,a,b) for(int i=a;i<b;i++)
#define F(i,a,b) for(int i=a;i>=    b;i--)
#define sz(a) ((int)a.size())
#define all(c) c.begin(), c.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
#define dbgs(x) cerr << (#x) << " --> " << (x) << ' '
#define dbg(x) cerr << (#x) << " --> " << (x) << endl

typedef long long ll;
typedef unsigned long long ull;
typedef pair <ll, ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pair<int, int> > vpii;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
typedef long double ld;

template <class T> const T& max(const T& a, const T&b, const T&c) { return max(a, max(b, c)); }

template <class T> const T& min(const T& a, const T&b, const T&c) { return min(a, min(b, c)); }

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

ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }

ll poww(ll a, ll b) {

	if (b == 0) return 1;

	ll tmp = poww(a, b / 2);

	return (b & 1 ? a * tmp * tmp : tmp * tmp);

}

ll sumOfDigs(string s) { ll sum = 0; for (int i = 0; i < s.length(); i++) sum += s[i] - '0'; return sum; }

ll sumOfDigs(ll n) { return (n < 10 ? n : n % 10 + sumOfDigs(n / 10)); }

string itos(ll i) { string s = ""; 	while (i) { s += char(i % 10 + '0'); i /= 10; } reverse(all(s));  return s; }

ll stoi(string &s) { ll tot = 0; for (int i = (int)s.length() - 1, j = 1; i >= 0; i--, j *= 10) { tot += j * (s[i] + '0'); }  return tot; }

int months[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

using namespace std;

#define PI acos((ld)-1.0)

void t(){

#ifndef online_judge
	freopen("test.txt", "r", stdin);
#endif
}

// printf("%.8lf\n", sum * 1.0 / n);  // precision setting

ll mod = 1000 * 1000 * 1000 + 7;;

ll modpower(ll x, ll y, ll p)
{

	x %= mod;

	if (!y) return 1;

	ll res = 1;

	if (y & 1) { res *= x;  res %= p; }

	ll z = modpower(x, y / 2, p);

	z %= p;

	z *= z;

	z %= mod;

	res *= z;

	res %= p;

	return res;

}

int a[1000], sieve[1000 * 1000], vis[1000 * 1000];

int main() {

	//t();

	string s;

	cin >> s;

	s.insert(0, 1, '0');
	//cout << "s: " << s << endl;
	int n = (int)s.length() - 1;
	//cout << "n: " << n << endl;

	int mx = 0;

	for (int i = 1; i <= n; i++)a[s[i] - 'a']++, mx = max(mx, a[s[i] - 'a']);

	for (int i = 1; i <= n; i++) s[i] = '*';

	sieve[1] = 1;

	for (int i = 1; i <= n; i++) {

		if (!sieve[i]) for (int j = 2 * i; j <= n; j += i) sieve[j] = 1;

	}

	int cnt = 0;

	for (int i = 2; i <= n / 2; i++) cnt++;

	for (int i = n / 2 + 1; i <= n; i++) if (sieve[i]) cnt++;

	if (mx < cnt) { return cout << "NO" << endl, 0;  }

	for (int i = 1; i <= n; i++) s[i] = '*';

	int pos = -1;

	for (int i = 0; i < 26; i++)  if (mx == a[i]) pos = i;

	//cout << "pos:  " << pos << endl;

	for (int i = 2; i <= n / 2; i++){ s[i] = char('a' + pos); a[pos]--;  }

	for (int i = n / 2 + 1; i <= n; i++) if (sieve[i]) s[i] = char('a' + pos), a[pos]--;

	//cout << "s: " << s << endl;

	cout << "YES" << endl;

	int j = 0;

	while (!a[j]) j++;
	s[1] = char('a' + j);
	a[j]--;

	//cout << "s: " << s << endl;

	for (int i = n / 2 + 1; i <= n; i++) {

		if (!sieve[i]) {

			while (!a[j]) j++;
			s[i] = char('a' + j);
			a[j]--;

		}

	}

	//cout << "s: " << s << endl;

	s = s.substr(1, n);
	cout << s << endl;

	return 0;

}


#include <cmath>
#include <ctime>
#include <iostream>
#include <string>
#include <vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<cctype>
#include <iomanip>
#include <string>
#include <sstream>
#include <functional>
#include <numeric>
#include <stack>
#include <climits>
#include <float.h>
#include<unordered_map>
#include <bitset>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define f(i,a,b) for(int i=a;i<b;i++)
#define F(i,a,b) for(int i=a;i>=    b;i--)
#define sz(a) ((int)a.size())
#define all(c) c.begin(), c.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
#define dbgs(x) cerr << (#x) << " --> " << (x) << ' '
#define dbg(x) cerr << (#x) << " --> " << (x) << endl

typedef long long ll;
typedef unsigned long long ull;
typedef pair <ll, ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pair<int, int> > vpii;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
typedef long double ld;

template <class T> const T& max(const T& a, const T&b, const T&c) { return max(a, max(b, c)); }

template <class T> const T& min(const T& a, const T&b, const T&c) { return min(a, min(b, c)); }

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

ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }

ll poww(ll a, ll b) {

	if (b == 0) return 1;

	ll tmp = poww(a, b / 2);

	return (b & 1 ? a * tmp * tmp : tmp * tmp);

}

ll sumOfDigs(string s) { ll sum = 0; for (int i = 0; i < s.length(); i++) sum += s[i] - '0'; return sum; }

ll sumOfDigs(ll n) { return (n < 10 ? n : n % 10 + sumOfDigs(n / 10)); }

string itos(ll i) { string s = ""; 	while (i) { s += char(i % 10 + '0'); i /= 10; } reverse(all(s));  return s; }

ll stoi(string &s) { ll tot = 0; for (int i = (int)s.length() - 1, j = 1; i >= 0; i--, j *= 10) { tot += j * (s[i] + '0'); }  return tot; }

int months[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

using namespace std;

#define PI acos((ld)-1.0)

void t(){

#ifndef online_judge
	freopen("test.txt", "r", stdin);
#endif
}

// printf("%.8lf\n", sum * 1.0 / n);  // precision setting

ll mod = 1000 * 1000 * 1000 + 7;;

ll modpower(ll x, ll y, ll p)
{

	x %= mod;

	if (!y) return 1;

	ll res = 1;

	if (y & 1) { res *= x;  res %= p; }

	ll z = modpower(x, y / 2, p);

	z %= p;

	z *= z;

	z %= mod;

	res *= z;

	res %= p;

	return res;

}

int a[1000], sieve[1000 * 1000], vis[1000 * 1000];

int main() {

	//t();
	string s;
	cin >> s;

	s.insert(0, 1, '0');

	//cout << "s: " << s << endl;

	vector<pair<int, char> > v;

	int n = (int)s.length() - 1;

	for (int i = 1; i < s.length(); i++) a[s[i] - 'a']++;

	for (int i = 0; i < 26; i++) if (a[i]) v.pb({ a[i], char('a' + i) });

	sort(all(v), greater<pair<int, char> >());

	for (int i = 1; i <= n; i++) s[i] = '*';

	sieve[1] = 1;

//	cout << "n: " << n << endl;

	for (int i = 1; i <= n; i++)  {

		if (!sieve[i])  {

			vi w;
			w.pb(i);

			for (int j = 2 * i; j <= n; j += i) {

				sieve[j] = 1;
				w.pb(j);

			}

			/*cout << "w: ";
			for (auto t : w) cout << t << " ";
			cout << endl;
*/
			if (v[0].ff < w.size()) { return cout << "NO" << endl, 0; }

			for (int k = 0; k < w.size(); k++)  {

				if (!vis[w[k]]) {

					v[0].ff--;
					vis[w[k]] = 1;

				}
				else  {

					if (s[w[k]] != v[0].ss) { return cout << "NO" << endl, 0; }

				}

				s[w[k]] = v[0].ss;

			}
			//v[0].ff -= (int)w.size();

			sort(all(v), greater<pair<char, int> >());

		}

	}

	/*cout << "HI" << endl;

	cout << "vis[]: "; for (int i = 1; i <= n; i++) if (!vis[i]) cout << i << " ";
	cout << endl;

	for (auto t : v) cout << t.ss << " " << t.ff << endl;
*/
	/*cout << endl << endl;
	cout << "s: " << s << endl;
	*/
	for (int i = 1; i <= n; i++) if (!vis[i]) {

		vis[i] = 1;
		if (v[0].ff < 1) { return cout << "NO" << endl, 0; }
		s[i] = v[0].ss;
		v[0].ff--;

		sort(all(v), greater<pair<int, char> >());
	}

	cout << "YES" << endl;
	s = s.substr(1, n);
	cout << s << endl;
	//cout << "s: " << s << endl;
	return  0;
}


//Daniel Grzegorzewski
#include <bits/stdc++.h>

#define MP make_pair
#define PB push_back
#define ST first
#define ND second

using namespace std;

typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VII;
typedef long long LL;

void init_ios()
{
     ios_base::sync_with_stdio(0);
     cin.tie(0);
}

string s;
int n, ile[26];
PII mx;
char res[1010];
bool vis[1010];

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

int main()
{
    init_ios();
    cin >> s;
    n = s.size();
    for (int i = 0; i < n; ++i) {
    	++ile[s[i]-'a'];
    	if (ile[s[i]-'a'] > mx.ST)
    		mx = {ile[s[i]-'a'], s[i]-'a'};
    }
    int trzeba = 0;
    for (int i = 2; i <= n; i += 2) {
    	++trzeba;
    	vis[i] = true;
    }
    for (int i = 3; i <= n; ++i)
    	if (prime(i) && 2*i <= n)
    		for (int j = i; j <= n; j += i)
    			if (!vis[j]) {
    				vis[j] = true;
    				++trzeba;
    			}
    if (trzeba > mx.ST) {
    	cout<<"NO\n";
    	return 0;
    }
    cout<<"YES\n";
    ile[mx.ND] -= trzeba;
    for (int i = 1; i <= n; ++i)
    	if (vis[i])
    		res[i] = (char)(mx.ND+'a');
    string aa = "";
    for (int i = 0; i < 26; ++i)
    	for (int j = 0; j < ile[i]; ++j)
    		aa += (char)(i+'a');
    int t = 0;
    for (int i = 1; i <= n; ++i) {
    	if (!vis[i])
    		res[i] = aa[t++];
    	cout<<res[i];
    }
    cout<<"\n";
}


//Daniel Grzegorzewski
#include <bits/stdc++.h>

#define MP make_pair
#define PB push_back
#define ST first
#define ND second

using namespace std;

typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VII;
typedef long long LL;

void init_ios()
{
     ios_base::sync_with_stdio(0);
     cin.tie(0);
}

string s;
int n, ile[26];
PII mx;
char res[1010];
bool vis[1010];

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

int main()
{
    init_ios();
    cin >> s;
    n = s.size();
    for (int i = 0; i < n; ++i) {
    	++ile[s[i]-'a'];
    	if (ile[s[i]-'a'] > mx.ST)
    		mx = {ile[s[i]-'a'], s[i]-'a'};
    }
    int trzeba = 0;
    for (int i = 1; i < n; i += 2) {
    	++trzeba;
    	vis[i] = true;
    }
    for (int i = 3; i <= n; ++i)
    	if (prime(i) && 2*i <= n)
    		for (int j = i; j <= n; j += i)
    			if (!vis[j]) {
    				vis[j] = true;
    				++trzeba;
    			}
    if (trzeba > mx.ST) {
    	cout<<"NO\n";
    	return 0;
    }
    cout<<"YES\n";
    ile[mx.ND] -= trzeba;
    for (int i = 1; i <= n; ++i)
    	if (vis[i])
    		res[i] = (char)(mx.ND+'a');
    string aa = "";
    for (int i = 0; i < 26; ++i)
    	for (int j = 0; j < ile[i]; ++j)
    		aa += (char)(i+'a');
    int t = 0;
    for (int i = 1; i <= n; ++i) {
    	if (!vis[i])
    		res[i] = aa[t++];
    	cout<<res[i];
    }
    cout<<"\n";
}


//Daniel Grzegorzewski
#include <bits/stdc++.h>

#define MP make_pair
#define PB push_back
#define ST first
#define ND second

using namespace std;

typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VII;
typedef long long LL;

void init_ios()
{
     ios_base::sync_with_stdio(0);
     cin.tie(0);
}

string s;
int n, ile[26];
PII mx;
char res[1010];
bool vis[1010];

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

int main()
{
    init_ios();
    cin >> s;
    n = s.size();
    for (int i = 0; i < n; ++i) {
    	++ile[s[i]-'a'];
    	if (ile[s[i]-'a'] > mx.ST)
    		mx = {ile[s[i]-'a'], s[i]-'a'};
    }
    int trzeba = 0;
    for (int i = 1; i <= n; i += 2) {
    	++trzeba;
    	vis[i] = true;
    }
    for (int i = 3; i <= n; ++i)
    	if (prime(i) && 2*i <= n)
    		for (int j = i; j <= n; j += i)
    			if (!vis[j]) {
    				vis[j] = true;
    				++trzeba;
    			}
    if (trzeba > mx.ST) {
    	cout<<"NO\n";
    	return 0;
    }
    cout<<"YES\n";
    ile[mx.ND] -= trzeba;
    for (int i = 1; i <= n; ++i)
    	if (vis[i])
    		res[i] = (char)(mx.ND+'a');
    string aa = "";
    for (int i = 0; i < 26; ++i)
    	for (int j = 0; j < ile[i]; ++j)
    		aa += (char)(i+'a');
    int t = 0;
    for (int i = 1; i <= n; ++i) {
    	if (!vis[i])
    		res[i] = aa[t++];
    	cout<<res[i];
    }
    cout<<"\n";
}


//Daniel Grzegorzewski
#include <bits/stdc++.h>

#define MP make_pair
#define PB push_back
#define ST first
#define ND second

using namespace std;

typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VII;
typedef long long LL;

void init_ios()
{
     ios_base::sync_with_stdio(0);
     cin.tie(0);
}

string s;
int n, ile[26];
char res[1010];
bool vis[1010];

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

int main()
{
    init_ios();
    cin >> s;
    n = s.size();
    for (int i = 0; i < n; ++i)
    	++ile[s[i]-'a'];
    for (int i = 2; i <= n; ++i)
    	if (prime(i)) {
    		PII best = {-1, -1};
    		for (int j = 0; j < 26; ++j)
    			if (ile[j] > best.ST)
    				best = {ile[j], j};
    		int trzeba = 0;
    		for (int j = i; j <= n; j += i)
    			if (!vis[j])
    				++trzeba;
    		if (trzeba > best.ST) {
    			cout<<"NO\n";
    			return 0;
    		}
    		for (int j = i; j <= n; j += i)
    			if (!vis[j]) {
    				res[j] = (char)(best.ND+'a');
    				vis[j] = true;
    			}
    		ile[best.ND] -= trzeba;
    	}
    int zost = -1;
    for (int i = 0; i < 26; ++i)
    	if (ile[i] > 0)
    		zost = i;
    res[1] = (char)(zost+'a');
    cout<<"YES\n";
    for (int i = 1; i <= n; ++i)
    	cout<<res[i];
    cout<<"\n";
}


//Daniel Grzegorzewski
#include <bits/stdc++.h>

#define MP make_pair
#define PB push_back
#define ST first
#define ND second

using namespace std;

typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VII;
typedef long long LL;

void init_ios()
{
     ios_base::sync_with_stdio(0);
     cin.tie(0);
}

string s;
int n, ile[26];
PII mx;
char res[1010];
bool vis[1010];

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

int main()
{
    init_ios();
    cin >> s;
    n = s.size();
    for (int i = 0; i < n; ++i) {
    	++ile[s[i]-'a'];
    	if (ile[s[i]-'a'] > mx.ST)
    		mx = {ile[s[i]-'a'], s[i]-'a'};
    }
    int trzeba = 0;
    for (int i = 1; i < n; i += 2) {
    	++trzeba;
    	vis[i] = true;
    }
    for (int i = 3; i <= n; ++i)
    	if (prime(i) && 2*i <= n)
    		for (int j = i; j <= n; j += i)
    			if (!vis[j]) {
    				vis[j] = true;
    				++trzeba;
    			}
    if (trzeba > mx.ST) {
    	cout<<"NO\n";
    	return 0;
    }
    cout<<"YES\n";
    ile[mx.ND] -= trzeba;
    for (int i = 1; i <= n; ++i)
    	if (vis[i])
    		res[i] = (char)(mx.ND+'a');
    string aa = "";
    for (int i = 0; i < 26; ++i)
    	for (int j = 0; j < ile[i]; ++j)
    		aa += (char)(i+'a');
    int t = 0;
    for (int i = 0; i < n; ++i)
    	if (!vis[i])
    		res[i] = aa[t++];
    cout<<res<<"\n";
}


import java.io.*;

import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class apples{

    public static void main(String[] args) {
    	Scanner zizo=new Scanner(System.in);
    	int n=zizo.nextInt();
    	String l="I love that";
    	String h="I hate that";
    	String r;
    	int i=1;
    	while(i<n-1) {
    		if(i%2==1) {
    			r+=h;
    		}else
    			r+=h;
    	i+=1;
    	}
    	if(n%2==0)
    		r+="I love it";
    	else
    		r+="I hate it";
    	}
    }


import java.io.*;

import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class apples{

    public static void main(String[] args) {
    	Scanner zizo=new Scanner(System.in);
    	int n=zizo.nextInt();
    	String l="I love that";
    	String h="I hate that";
    	String r="";
    	int i=1;
    	while(i<n-1) {
    		if(i%2==1) {
    			r+=h;
    		}else
    			r+=h;
    	i+=1;
    	}
    	if(n%2==0)
    		r+="I love it";
    	else
    		r+="I hate it";
    	System.out.println(r);
    }

    }


import java.io.*;

import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class apples{

    public static void main(String[] args) {
    	Scanner zizo=new Scanner(System.in);
    	int n=zizo.nextInt();
    	String l="I love that";
    	String h="I hate that";
    	String r="";
    	int i=1;
    	while(i<n) {
    		if(i%2==1) {
    			r+=" "+h;
    		}else
    			r+=" "+l;
    	i+=1;
    	}
    	if(n%2==0)
    		r+=" "+"I love it";
    	else
    		r+=" "+"I hate it";
    	System.out.println(r);
    }

    }


import java.io.*;

import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class apples{

    public static void main(String[] args) {
    	Scanner zizo=new Scanner(System.in);
    	int n=zizo.nextInt();
    	String l="I love that";
    	String h="I hate that";
    	String r="";
    	int i=1;
    	while(i<n-1) {
    		if(i%2==1) {
    			r+=h;
    		}else
    			r+=h;
    	i+=1;
    	}
    	if(n%2==0)
    		r+="I love it";
    	else
    		r+="I hate it";
    	}
    }


import java.util.Scanner;
public class imagine {

	private static Scanner butts;

	public static void main(String[] args) {
		butts = new Scanner(System.in);
		int n = butts.nextInt();

		if(n == 1)
		{
			System.out.println("I hate it");
		}
		if(n == 2)
		{
			System.out.println("I hate that I love it");
		}
		if(n == 3)
		{
			System.out.println("I hate that I love that I hate it");
		}
		else
		{
			System.exit(n);
		}
	}
}


import java.util.Scanner;
public class imagine {

	private static Scanner butts;

	public static void main(String[] args) {
		butts = new Scanner(System.in);
		int n = butts.nextInt();

		if(n == 1)
		{
			System.out.println("I hate it");
		}
		if(n == 2)
		{
			System.out.println("I hate that I love it");
		}
		if(n == 3)
		{
			System.out.println("I hate that I love that I hate it");
		}
	}
}


import java.util.Scanner;
public class imagine {

	public static void main(String[] args) {
		Scanner poo = new Scanner(System.in);
		int n = poo.nextInt();

		if(n == 1)
		{
			System.out.println("I hate it");
		}
		if(n == 2)
		{
			System.out.println("I hate that I love it");
		}
		if(n == 3)
		{
			System.out.println("I hate that I love that I hate it");
		}
		else
		{
			System.exit(n);
		}
	}
}


import java.util.Scanner;
public class imagine {

	private static Scanner butts;

	public static int main(String[] args) {
		butts = new Scanner(System.in);
		int n = butts.nextInt();
		for(int i = 1; i <= n; i++)
		{
		if(i%2==1)
		{
			System.out.println("I hate that");
		}
		else
		{
			System.out.println("I love that");
		}
		if(i==n)

		if(n%2==1)
		{
			System.out.println("I hate it");
		}
		if(n%2==0)
		{
			System.out.println("I love it");
		}
		}
		return 0;
	}
}


import java.util.Scanner;
public class imagine {

    private static Scanner butts;

    public static void main(String[] args) {
        butts = new Scanner(System.in);
        int n = butts.nextInt();
        int shiva = 0;
        for(int i = 1; i < n; i++)
        {
        	shiva=i;
        if(i%2==0)
        {

            System.out.print(" I love that ");
        }
        else
        {
            System.out.print("I hate that");
        }
        }
        shiva++;
        if(shiva==n)
        {
            if(n%2==1)
            {
                System.out.print("I hate it");
            }
            if(n%2==0)
            {
                System.out.print(" I love it");
            }
        }

    }
}


import java.util.Scanner;
public class imagine {

	private static Scanner butts;

	public static void main(String[] args) {
		butts = new Scanner(System.in);
		int n = butts.nextInt();
		for(int i = 1; i <= n; i++)
		{
		if(i%2==1)
		{
			System.out.println("I hate that");
		}
		else
		{
			System.out.println("I love that");
		}
		}
		if(n%2==1)
		{
			System.out.println("I hate it");
		}
		if(n%2==0)
		{
			System.out.println("I love it");
		}

	}
}


import java.util.*;

public class Main {

    public static void main(String[] args) {
    Scanner sc= new Scanner(System.in);
    Zidan(Integer.parseInt(sc.nextLine()));
        }
public static void Zidan(int x){
       String y="";
        for (int i=1 ; i <= x-1  ; i++ ){
             if (i%2==0){
                 y=y+"I love that ";

             }
             else {
                 y=y+"I hate that ";
            }
        }
        if(x%2==0){
           y+="I love it";

        }
        else{
            y+="I love it";
        }

    System.out.print(y);

    }

}


import java.util.*;

public class Main {

    public static void main(String[] args) {
System.out.print( Zidan (2));
        }
public static String Zidan(int x){
if (x%3==0){
    return ("i hate it that i love it");

}
 else if (x%2==0)       {
    return("that ilove it");
 }
 else {
    return("i hate it");
 }

}


import java.util.*;

public class Main {

    public static void main(String[] args) {
    Scanner sc= new Scanner(System.in);
    Zidan(Integer.parseInt(sc.nextLine()));
        }
public static void Zidan(int x){
       String y="";
        for (int i=1 ; i <= x  ; i++ ){
             if (i%2==0){
                 y=y+"that I love it ";

             }
             else {
                 y=y+"I hate it ";
            }
        }

    System.out.print(y);

    }
}


import java.util.*;

public class Main {

    public static void main(String[] args) {
    Zidan (3);
        }
public static void Zidan(int x){
       String y="";
        for (int i=1 ; i <= x  ; i++ ){
             if (i%2==0){
                 y=y+"that I love it ";

             }
             else {
                 y=y+"I hate it ";
            }
        }

    System.out.print(y);

    }

}


import java.util.*;

public class Main {

    public static void main(String[] args) {
    Zidan (6);
        }
public static void Zidan(int x){
       String y="";
        for (int i=1 ; i <= x  ; i++ ){
             if (i%2==0){
                 y=y+""+" that I love it ";

             }
             else {
                 y=y+""+" I hate it ";
            }
        }

    System.out.print(y);

    }

}


import java.util.*;

public class Main {

    public static void main(String[] args) {
System.out.print( Zidan (2));
        }
public static String Zidan(int x){
if (x%3==0){
    return ("i hate it that i love it");

}
 else if (x%2==0)       {
    return("that ilove it");
 }
 else {
    return("i hate it");
 }

}
}


import java.util.*;

public class Main {

    public static void main(String[] args) {
System.out.print( Zidan (2));
        }
public static String Zidan(int x){
if (x%3==0){
    return ("i hate it that i love it");

}
 else if (x%2==0)       {
    return("that i love it");
 }
 else {
    return("i hate it");
 }

}

}


import java.util.*;

public class Main {

    public static void main(String[] args) {
System.out.print( Zidan (2));
        }
public static String Zidan(int x){
if (x%3==0){
    return ("I hate it that I love it");

}
 else if (x%2==0)       {
    return("that I love it");
 }
 else {
    return("I hate it");
 }

}

}


import java.util.*;

public class Main {

    public static void main(String[] args) {
    Scanner sc= new Scanner(System.in);
    Zidan(Integer.parseInt(sc.nextLine()));
        }
public static void Zidan(int x){
       String y="";
        for (int i=1 ; i <= x-1  ; i++ ){
             if (i%2==0){
                 y=y+"I love that ";

             }
             else {
                 y=y+"I hate that ";
            }
        }
        if(x%2==0){
           y+="I love it";

        }
        else{
            y+="I hate it";
        }

    System.out.print(y);


import java.util.*;

public class Main {

    public static void main(String[] args) {
    Scanner sc= new Scanner(System.in);
    Zidan(Integer.parseInt(sc.nextLine()));
        }
public static void Zidan(int x){
       String y="";
        for (int i=1 ; i <= x-1  ; i++ ){
             if (i%2==0){
                 y=y+"I love that ";

             }
             else {
                 y=y+"I hate that ";
            }
        }
        if(x%2==0){
           y+="I love it";

        }
        else{
            y+="I hate it";
        }

    System.out.print(y);
}
}


package babysteps;
import java.util.Scanner;
public class apples {
	public static void main (String args[]) {
	Scanner sc=new Scanner(System.in);
     int a=sc.nextInt();
   for (int i=1;i<=a;i++) {

	   if (i%2!=0) {
		   System.out.println("I hate it");
	   }
	   else {
		   System.out.println("I love it");
	   }
   }

}
}


import java.util.Scanner;
public class apples {
	public static void main (String args[]) {
	Scanner sc=new Scanner(System.in);
     int a=sc.nextInt();
   for (int i=1;i<=a;i++) {

	   if (i%2!=0) {
		   if(i==a)
		   System.out.print("I hate it");
		   else
			   System.out.print("I hate that");
	   }
	   else {
		   if(i==a)
		   System.out.print(" I love it");
		   else
			   System.out.print(" I love that");
	   }
   }

}
}


package babysteps;
import java.util.Scanner;
public class apples {
	public static void main (String args[]) {
	Scanner sc=new Scanner(System.in);
     int a=sc.nextInt();
   for (int i=1;i<=a;i++) {

	   if (i%2!=0) {
		   if(i==a)
		   System.out.print("I hate it");
		   else
			   System.out.print("I hate that");
	   }
	   else {
		   if(i==a)
		   System.out.print(" I love it");
		   else
			   System.out.print(" I love that");
	   }
   }

}
}


import java.util.Scanner;
public class apples {
	public static void main (String args[]) {
	Scanner sc=new Scanner(System.in);
     int a=sc.nextInt();
   for (int i=1;i<=a;i++) {

	   if (i%2!=0) {
		   System.out.print("I hate it");
	   }
	   else {
		   System.out.print("I love it");
	   }
   }

}
}


import java.util.Scanner;
public class apples {
	public static void main (String args[]) {
	Scanner sc=new Scanner(System.in);
     int a=sc.nextInt();
   for (int i=1;i<=a;i++) {

	   if (i%2!=0) {
		   System.out.print("I hate it");
	   }
	   else {
		   System.out.print(" I love it");
	   }
   }

}
}


import java.util.Scanner;
public class apples {
	public static void main (String args[]) {
	Scanner sc=new Scanner(System.in);
     int a=sc.nextInt();
   for (int i=1;i<=a;i++) {

	   if (i%2!=0) {
		   if(i==a)
		   System.out.print("I hate it");
		   else
			   System.out.print("I hate that");
	   }
	   else {
		   if(i==a)
		   System.out.print("I love it");
		   else
			   System.out.print("I love that");
	   }
	   System.out.print(" ");
   }

}
}


package babysteps;
import java.util.Scanner;
public class apples {
	public static void main (String args[]) {
	Scanner sc=new Scanner(System.in);
     int a=sc.nextInt();
   for (int i=1;i<=a;i++) {

	   if (i%2!=0) {
		   if(i==a)
		   System.out.print("I hate it");
		   else
			   System.out.print("I hate that");
	   }
	   else {
		   if(i==a)
		   System.out.print(" I love it");
		   else
			   System.out.print("I love that");
	   }
	   System.out.print(" ");
   }

}
}


import java.util.Scanner;

/**
 *
 * @author abosala7
 */
public class Hulk {

    /**
     *
     */

    public static void main(String[] args) {
        String printMessage ="";
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage=printMessage+"I hate ";
                 feelingNum = 1;
            }
            else {
                 printMessage=printMessage+"I love ";
                feelingNum = 0;
            }
            if (i+1 >= num) printMessage=printMessage+"it";
            else printMessage=printMessage+"that ";
        }
        System.out.println(printMessage);
    }
}


import java.util.Scanner;

/**
 *
 * @author abosala7
 */
public class Hulk {

    /**
     *
     */
    public static int feelingNum = 0 ;
    public static String printMessage = "";

    public static void main(String[] args) {
        System.out.println("please enter number");
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage+="I hate";
                 feelingNum = 1;
            }
            else {
                printMessage+="I love";
                feelingNum = 0;
            }
            if (i+1 >= num)printMessage+=" it";
            else printMessage+=" that ";
        }
        System.out.println(printMessage);
    }
}


import java.util.Scanner;

public class Hulk {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String res = "";
		for (int i = 1; i <= n; i++) {
			if ((i & 1) == 0)
				res += "I love";
			else
				res += "I hate";
			if (i != n)
				res += " that ";
			else
				res += " it";
		}
		System.out.println(res);
	}

}


import static java.time.Clock.system;
import java.util.ArrayList;
import java.util.Scanner;

/**
 *
 * @author abosala7
 */
public class Hulk {

    /**
     *
     */
    public static String feelings[] = {"I hate ","I love "};
    public static int feelingNum = 0 ;
    public static String printMessage = "";

    public static void main(String[] args) {
        System.out.println("please enter number");
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage=printMessage+feelings[0];
                 feelingNum = 1;
            }
            else {
                 printMessage=printMessage+feelings[1];
                feelingNum = 0;
            }
            if (i+1 >= num) printMessage=printMessage+"it";
            else printMessage=printMessage+"that ";
        }
        System.out.println(printMessage);
    }
}


import java.util.Scanner;

public class Hulk {

    /**
     *
     */
    public static int feelingNum = 0 ;
    public static String printMessage = "";

    public static void main(String[] args) {
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage=printMessage+"I hate ";
                 feelingNum = 1;
            }
            else {
                 printMessage=printMessage+"I love ";
                feelingNum = 0;
            }
            if (i+1 >= num) printMessage=printMessage+"it";
            else printMessage=printMessage+"that ";
        }
        System.out.println(printMessage);
    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package problemsolving.day1;

import static java.time.Clock.system;
import java.util.ArrayList;
import java.util.Scanner;

/**
 *
 * @author abosala7
 */
public class Hulk {

    /**
     *
     */
    public static String feelings[] = {"I hate ","I love "};
    public static int feelingNum = 0 ;
    public static String printMessage = "";

    public static void main(String[] args) {
        System.out.println("please enter number");
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage=printMessage+" "+feelings[0];
                 feelingNum = 1;
            }
            else {
                 printMessage=printMessage+" "+feelings[1];
                feelingNum = 0;
            }
            if (i+1 >= num) printMessage=printMessage+" it";
            else printMessage=printMessage+" that";
        }
        System.out.println(printMessage);
    }
}


import static java.time.Clock.system;
import java.util.ArrayList;
import java.util.Scanner;

/**
 *
 * @author abosala7
 */
public class Hulk {

    /**
     *
     */
    public static String feelings[] = {"I hate ","I love "};
    public static int feelingNum = 0 ;
    public static String printMessage = "";

    public static void main(String[] args) {
        System.out.println("please enter number");
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage=printMessage+feelings[0];
                 feelingNum = 1;
            }
            else {
                 printMessage=printMessage+feelings[1];
                feelingNum = 0;
            }
            if (i+1 >= num) printMessage=printMessage+"it ";
            else printMessage=printMessage+"that ";
        }
        System.out.println(printMessage);
    }
}


import java.util.Scanner;

/**
 *
 * @author abosala7
 */
public class Hulk {

    /**
     *
     */
    public static int feelingNum = 0 ;
    public static String printMessage = "";

    public static void main(String[] args) {
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage=printMessage+"I hate ";
                 feelingNum = 1;
            }
            else {
                 printMessage=printMessage+"I love ";
                feelingNum = 0;
            }
            if (i+1 >= num) printMessage=printMessage+"it";
            else printMessage=printMessage+"that ";
        }
        System.out.println(printMessage);
    }
}


import java.util.Scanner;

/**
 *
 * @author abosala7
 */
public class Hulk {

    public static void main(String[] args) {
        int feelingNum = 0 ;
        String printMessage = "";
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage+="I hate";
                 feelingNum = 1;
            }
            else {
                printMessage+="I love";
                feelingNum = 0;
            }
            if (i+1 >= num)printMessage+=" it";
            else printMessage+=" that ";
        }
        System.out.println(printMessage);
    }
}


import static java.time.Clock.system;
import java.util.ArrayList;
import java.util.Scanner;

/**
 *
 * @author abosala7
 */
public class Hulk {

    /**
     *
     */
    public static String feelings[] = {"I hate ","I love "};
    public static int feelingNum = 0 ;
    public static String printMessage = "";

    public static void main(String[] args) {
        System.out.println("please enter number");
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage=printMessage+"I hate ";
                 feelingNum = 1;
            }
            else {
                 printMessage=printMessage+"I love "";
                feelingNum = 0;
            }
            if (i+1 >= num) printMessage=printMessage+"it";
            else printMessage=printMessage+"that ";
        }
        System.out.println(printMessage);
    }
}


import java.util.Scanner;

/**
 *
 * @author abosala7
 */
public class Hulk {

    /**
     *
     */
    public static int feelingNum = 0 ;
    public static String printMessage = "";

    public static void main(String[] args) {
        System.out.println("please enter number");
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage=printMessage+"I hate ";
                 feelingNum = 1;
            }
            else {
                 printMessage=printMessage+"I love ";
                feelingNum = 0;
            }
            if (i+1 >= num) printMessage=printMessage+"it";
            else printMessage=printMessage+"that ";
        }
        System.out.println(printMessage);
    }
}


import java.util.Scanner;

/**
 *
 * @author abosala7
 */
public class Hulk {

    /**
     *
     */
    public static int feelingNum = 0 ;
    public static String printMessage = "";

    public static void main(String[] args) {
        System.out.println("please enter number");
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage=printMessage+"I hate";
                 feelingNum = 1;
            }
            else {
                 printMessage=printMessage+"I love";
                feelingNum = 0;
            }
            if (i+1 >= num) printMessage=printMessage+" it";
            else printMessage=printMessage+" that ";
        }
        System.out.println(printMessage);
    }
}


import java.util.Scanner;

public class Hulk {

    public static int feelingNum = 0 ;
    public static String printMessage = "";

    public static void main(String[] args) {
        System.out.println("please enter number");
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage=printMessage+"I hate ";
                 feelingNum = 1;
            }
            else {
                 printMessage=printMessage+"I love ";
                feelingNum = 0;
            }
            if (i+1 >= num) printMessage=printMessage+"it";
            else printMessage=printMessage+"that ";
        }
        System.out.println(printMessage);
    }
}


public class Hulk {

    /**
     *
     */
    public static String feelings[] = {"I hate ","I love "};
    public static int feelingNum = 0 ;
    public static String printMessage = "";

    public static void main(String[] args) {
        System.out.println("please enter number");
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage=printMessage+feelings[0];
                 feelingNum = 1;
            }
            else {
                 printMessage=printMessage+feelings[1];
                feelingNum = 0;
            }
            if (i+1 >= num) printMessage=printMessage+"it ";
            else printMessage=printMessage+"that ";
        }
        System.out.println(printMessage);
    }
}


import static java.time.Clock.system;
import java.util.ArrayList;
import java.util.Scanner;

public class Hulk {

    /**
     *
     */
    public static int feelingNum = 0 ;
    public static String printMessage ="";

    public static void main(String[] args) {
        System.out.println("please enter number");
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage=printMessage+"I hate ";
                 feelingNum = 1;
            }
            else {
                 printMessage=printMessage+"I love ";
                feelingNum = 0;
            }
            if (i+1 >= num) printMessage=printMessage+"it";
            else printMessage=printMessage+"that ";
        }
        System.out.println(printMessage);
    }
}


import static java.time.Clock.system;
import java.util.ArrayList;
import java.util.Scanner;

/**
 *
 * @author abosala7
 */
public class Hulk {

    /**
     *
     */
    public static String feelings[] = {"I hate ","I love "};
    public static int feelingNum = 0 ;
    public static String printMessage = "";

    public static void main(String[] args) {
        System.out.println("please enter number");
        Scanner myScanner = new Scanner(System.in);
        int num = myScanner.nextInt();
        for (int i = 0 ; i < num ; i++){
            if(feelingNum == 0){
                 printMessage=printMessage+" "+feelings[0];
                 feelingNum = 1;
            }
            else {
                 printMessage=printMessage+" "+feelings[1];
                feelingNum = 0;
            }
            if (i+1 >= num) printMessage=printMessage+" it";
            else printMessage=printMessage+" that";
        }
        System.out.println(printMessage);
    }
}