import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by boris on 21.03.2016.
 */
public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        char[] chars = reader.readLine().trim().toCharArray();

        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        for (int i = 1; i < Math.round(chars.length/2.0); i++) {
            if (chars[i] == chars[0]) {
                baos.write(chars[i]);
                int on = 1;
                for (int f = i+1; f < chars.length; f++) {
                    if (chars[f] != chars[on++]) {
                        baos.reset();
                        break;
                    } else
                        baos.write(chars[f]);
                }
                if (baos.size() > 0)
                    break;
            }
        }

        if (baos.size() > 0) {
            System.out.println("YES");
            System.out.println(new String(baos.toByteArray()));
        } else
            System.out.println("NO");
    }
}

import java.util.Scanner;

public class A {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		char[] a = in.next().toCharArray();
		for (int i = 1; i < (a.length%2 == 0 ? a.length/2 : a.length/2+1); i++) {
			if (a[i] == a[0]) {
				for (int j = i+1; j < a.length; j++) {
					if (a[j] != a[j-i]) break;
					else if (j == a.length - 1 && j-i >= a.length/2) {
						System.out.println("YES");
						for (int k = 0; k <= j-i; k++) {
							System.out.print(a[k]);
						}
						return;
					}
				}
			}
		}
		System.out.println("NO");
	}
}

import java.util.Scanner;

public class Mistake {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		for(int i = s.length()/2; i < s.length()-1; i++){
			if(s.substring(0, i + 1).equals(s.substring(s.length()-(i+1), s.length()))){
				System.out.println("YES");
				System.out.println(s.substring(s.length()-(i+1), s.length()));
				sc.close();
				return;
			}
		}
		System.out.println("NO");
		sc.close();
	}
}

import java.io.PrintWriter;
import java.util.Scanner;

public class prog_1 {
	static int[] pref(String a) {
		int pr[] = new int[a.length()];
		int l = 0;
		for (int i = 1; i < pr.length; i++) {
			if (a.charAt(i) == a.charAt(pr[i - 1]))
				pr[i] = pr[i - 1] + 1;
			else {
				l = pr[i - 1];
				while (l > 0 && a.charAt(l) != a.charAt(i))
					l = pr[l - 1];
				if (a.charAt(i) == a.charAt(l))
					l++;
				pr[i] = l;
			}
		}
		return pr;
	}

	static int chek(int id, int l, String a) {
		int mas[] = pref(a);
		if (mas[mas.length - 1] == id && id * 2 > l)
			return 1;
		else
			return 0;
	}

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		String s = in.nextLine();
		boolean OK = false;
		for (int i = 1; i < s.length() && !OK; i++) {
			if (chek(i, s.length(), s.substring(0, i) + "&" + s) == 1) {
				OK = true;
				out.println("YES");
				out.println(s.substring(0, i));
			}
		}
		if(!OK)
			out.print("NO");
		in.close();
		out.close();

	}

}

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

public class OlympB{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String t;
		String s = "";
		int anchor = 0;
		t = sc.nextLine();
		int k = t.length();
		int m = 1;
		for(m = 1; m < t.length();m++){
			for(int i = 1; i < t.length()-m; i++){
				if(t.substring(0,i+m).equals(t.substring(i, k))){
					s = t.substring(0,i+m);
					anchor = 1;
					break;
				}
				if(anchor == 1){
					break;
				}
			}
		}
		if(anchor == 0){
			System.out.print("NO");
		}else{
			System.out.print("YES" + "\n" + s);
		}
	}
}

import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

/**
 * Created by Андрей on 19.03.2016.
 */
public class C {
    public static PrintWriter pw;
    public static void main(String[] args) throws FileNotFoundException {
        //        Scanner    in = new Scanner(new File("automation.in"));
        //           pw = new PrintWriter(new File("automation.out"));
        Scanner in = new Scanner(System.in);
        pw = new PrintWriter(System.out);
        String t=in.next();
        StringBuffer t0=new StringBuffer(t);
        String s="";
        int mid;
        if(t.length()%2==0)mid=t.length()/2;
        else mid=t.length()/2+1;
        if(t.length()<=2)pw.println("NO");
        else {
            for (int i = 1; i < mid; i++) {
                if (t.charAt(i)==t.charAt(0)){
                    int j=i+1; String s0=""+t.charAt(i);
                    while(j<t.length() && t.charAt(j)==t.charAt(j-i)){
                        s0+=t.charAt(j);
                        j++;
                    }
                    if(j==t.length() && s0.length()!=0){
                        s=s0;
                        break;
                    }
                }
            }
            if(s.length()!=0){
                pw.println("YES");
                pw.print(s);
            }else pw.println("NO");
        }

        pw.close();

    }

}

import java.util.Scanner;

public class Main {
   static boolean f = false,flag = false;
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String a = "", c = "";

        String s = scan.next();
        char[] sArray = s.toCharArray();
        if (sArray.length <= 100) {

                if (sArray.length % 2 != 0) {
                    for (int i = sArray.length / 2 + 1; i < sArray.length; i++) {
                        for (int y = 0; y < i ; y++) {
                                a = a + sArray[y];
                        }
                        for (int y = sArray.length - i ; y < sArray.length;y++){
                            c = c + sArray[y];
                        }
                        if (a.equals(c)) {
                                f = true;
                                break;
                            }
                            a = "";
                            c = "";
                        }
                }
                if (sArray.length % 2 == 0) {
                    for (int i = sArray.length / 2 ; i < sArray.length - 1 ; i++) {
                            for (int y = 0; y < i + 1; y++) {
                                a = a + sArray[y];
                            }
                            for (int y = sArray.length - i - 1; y < sArray.length ;y++){
                                c = c + sArray[y];
                            }
                        if (a.equals(c)) {
                            f = true;break;
                        }
                        a = "";
                        c = "";

                    }

                }

                 {
                  String m = c;
                    c = "";
                    a = "";
                    for (int y = sArray.length / 2; y < sArray.length; y++) {
                        c = c + sArray[y];
                        a = sArray[sArray.length - 1 - y] + a;

                    }
                    if (a.equals(c)) {
                        flag = true;

                    }
                    if ((!f && !flag) || (!f && flag)){
                        System.out.print("NO");
                    }
                     if ((f) || (f && !flag)){
                         System.out.print("YES\n" + m);

                     }
                }
            }
        }
    }

/*
                        }*/

import java.util.Scanner;

public class CFA {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String s = in.next();
		int n = s.length();
		int r = 1;
		int l = n-1;
		while (r<l){
			if (s.substring(0, l).equals(s.substring(r, n))){
				System.out.println("YES");
				System.out.println(s.substring(0, l));
				return;
			}
			r++;
			l--;
		}
		System.out.println("NO");

	}

}

import java.util.Scanner;

public class TextError {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String t = in.next();
		int length = t.length();
		int overlay = length - 2;

		boolean answer = false;
		String s = null;

		for (int i = overlay; i >= 1; i -= 2) {
			int sLength = (length + i) / 2;
			if (t.substring(0, sLength).equals(t.substring(length - sLength, length))) {
				answer = true;
				s = t.substring(0, sLength);
				break;
			}
		}

		if (answer) {
			System.out.println("YES");
			System.out.println(s);
		}
		else {
			System.out.println("NO");
		}
		in.close();
	}

}

import java.util.Scanner;

public class MessageError {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String src = in.nextLine();
		in.close();
		int lastIndex = 1;
		int index = 0;
		index = src.indexOf(src.charAt(0) + "", lastIndex);
		while (index >= 0 && index < src.length()) {
			String s2 = src.substring(index, src.length());
			index = src.indexOf(src.charAt(0) + "", lastIndex);
			lastIndex = index + 1;
			if (src.startsWith(s2) && s2.length() * 2 > src.length()) {
				System.out.println("YES");
				System.out.println(s2);
				System.exit(0);
			}
		}
		System.out.println("NO");

	}

}

import java.util.Scanner;

public class Main {
   static boolean f = false,flag = false;
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String a = "", c = "";

        String s = scan.next();
        char[] sArray = s.toCharArray();
        if (sArray.length < 100) {

                if (sArray.length % 2 != 0) {
                    for (int i = sArray.length / 2 + 1; i < sArray.length; i++) {
                        for (int y = 0; y < i; y++) {
                            c = c + sArray[y];
                            a = sArray[sArray.length - 1 - y] + a;
                        }
                        if (a.equals(c)) {
                            f = true;
                            break;
                        }
                    }
                }
                if (sArray.length % 2 == 0) {
                    for (int i = sArray.length / 2 ; i < sArray.length; i++) {
                        for (int y = 0; y < i; y++) {
                            a = sArray[sArray.length - 1 - y] + a;
                            c = c + sArray[y];

                        }
                        if (a.equals(c)) {
                            f = true;break;
                        }

                    }

                }

                 {
                  String m = c;
                    c = "";
                    a = "";
                    for (int y = sArray.length / 2; y < sArray.length; y++) {
                        c = c + sArray[y];
                        a = sArray[sArray.length - 1 - y] + a;

                    }
                    if (a.equals(c)) {
                        flag = true;

                    }
                    if ((!f && !flag) || (!f && flag)){
                        System.out.print("NO");
                    }
                     if ((f) || (f && !flag)){
                         System.out.print("YES\n" + m);

                     }
                }
            }
        }
    }

import java.util.Scanner;

public class Main {
    static boolean f = false, flag = false;

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String a = "", c = "";

        String s = scan.next();
        char[] sArray = s.toCharArray();
        if (sArray.length <= 100) {

            if (sArray.length % 2 != 0) {
                for (int i = sArray.length / 2; i < sArray.length; i++) {
                    for (int y = 0; y < i + 1; y++) {
                        a = a + sArray[y];
                    }
                    for (int y = sArray.length - i - 1; y < sArray.length; y++) {
                        c = c + sArray[y];
                    }
                    if (a.equals(c)) {
                        f = true;
                        break;
                    }
                    a = "";
                    c = "";
                }
            }
            if (sArray.length % 2 == 0) {
                for (int i = sArray.length / 2; i < sArray.length - 1; i++) {
                    for (int y = 0; y < i; y++) {
                        c = c + sArray[y];
                        a = sArray[sArray.length - 1 - y] + a;
                        if (a.equals(c)) {
                            f = true;
                            break;
                        }
                        a = "";
                        c = "";

                    }
                }
                }

                {
                    String m = c;
                    c = "";
                    a = "";
                    for (int y = sArray.length / 2; y < sArray.length; y++) {
                        c = c + sArray[y];
                        a = sArray[sArray.length - 1 - y] + a;

                    }
                    if (a.equals(c)) {
                        flag = true;

                    }
                    if ((!f && !flag) || (!f && flag)) {
                        System.out.print("NO");
                    }
                    if ((f) || (f && !flag)) {
                        System.out.print("YES\n" + m);

                    }
                }

        }
    }
}

/*
                        }*/

import java.util.Scanner;

public class Main {
   static boolean f = false,flag = false;
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String a = "", c = "";

        String s = scan.next();
        char[] sArray = s.toCharArray();
        if (sArray.length <= 100) {

                if (sArray.length % 2 != 0) {
                    for (int i = sArray.length / 2 ; i < sArray.length; i++) {
                        for (int y = 0; y < i + 1; y++) {
                            a = a + sArray[y];
                        }
                        for (int y = sArray.length - i - 1; y < sArray.length ;y++){
                            c = c + sArray[y];
                        }
                        if (a.equals(c)) {
                            f = true;
                            break;
                        }
                        a ="";
                        c = "";
                    }
                }
                if (sArray.length % 2 == 0) {
                    for (int i = sArray.length / 2 ; i < sArray.length - 1 ; i++) {
                            for (int y = 0; y < i + 1; y++) {
                                a = a + sArray[y];
                            }
                            for (int y = sArray.length - i - 1; y < sArray.length ;y++){
                                c = c + sArray[y];
                            }
                        if (a.equals(c)) {
                            f = true;break;
                        }
                        a = "";
                        c = "";

                    }

                }

                 {
                  String m = c;
                    c = "";
                    a = "";
                    for (int y = sArray.length / 2; y < sArray.length; y++) {
                        c = c + sArray[y];
                        a = sArray[sArray.length - 1 - y] + a;

                    }
                    if (a.equals(c)) {
                        flag = true;

                    }
                    if ((!f && !flag) || (!f && flag)){
                        System.out.print("NO");
                    }
                     if ((f) || (f && !flag)){
                         System.out.print("YES\n" + m);

                     }
                }
            }
        }
    }

/*  for (int y = 0; y < i; y++) {
                            c = c + sArray[y];
                            a = sArray[sArray.length - 1 - y] + a;
                        }*/

import java.util.Scanner;

public class Main {
   static boolean f = false;
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String a = "", c = "";

        String s = scan.next();
        char[] sArray = s.toCharArray();
        if (sArray.length < 100) {

                if (sArray.length % 2 != 0) {
                    for (int i = sArray.length / 2 + 1; i < sArray.length; i++) {
                        for (int y = 0; y < i; y++) {
                            c = c + sArray[y];
                            a = sArray[sArray.length - 1 - y] + a;
                        }
                        if (a.equals(c)) {
                            f = true;
                            System.out.print("YES\n" + c);
                            break;
                        }
                    }
                }
                if (sArray.length % 2 == 0) {
                    for (int i = sArray.length / 2; i < sArray.length; i++) {
                        for (int y = 0; y < i; y++) {
                            c = c + sArray[y];
                            a = sArray[sArray.length - 1 - y] + a;
                        }
                        if (a.equals(c)) {
                            f = true;
                            System.out.print("YES\n" + c);
                            break;
                        }
                    }

                }
                if (!f) {
                    c = "";
                    a = "";
                    for (int y = sArray.length / 2; y < sArray.length; y++) {
                        c = c + sArray[y];
                        a = sArray[sArray.length - 1 - y] + a;

                    }
                    if (a.equals(c)) {
                        f = true;
                        System.out.print("NO");
                    }

                    System.out.print("NO");
                }
            }
        }
    }

import java.util.Scanner;

public class Main {
   static boolean f = false,flag = false;
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String a = "", c = "";

        String s = scan.next();
        char[] sArray = s.toCharArray();
        if (sArray.length < 100) {

                if (sArray.length % 2 != 0) {
                    for (int i = sArray.length / 2 + 1; i < sArray.length; i++) {
                        for (int y = 0; y < i; y++) {
                            c = c + sArray[y];
                            a = sArray[sArray.length - 1 - y] + a;
                        }
                        if (a.equals(c)) {
                            f = true;
                            break;
                        }
                    }
                }
                if (sArray.length % 2 == 0) {
                    for (int i = sArray.length / 2 ; i < sArray.length - 1 ; i++) {
                            for (int y = 0; y < i + 1; y++) {
                                a = a + sArray[y];
                            }
                            for (int y = sArray.length - i - 1; y < sArray.length ;y++){
                                c = c + sArray[y];
                            }
                        if (a.equals(c)) {
                            f = true;break;
                        }
                        a = "";
                        c = "";

                    }

                }

                 {
                  String m = c;
                    c = "";
                    a = "";
                    for (int y = sArray.length / 2; y < sArray.length; y++) {
                        c = c + sArray[y];
                        a = sArray[sArray.length - 1 - y] + a;

                    }
                    if (a.equals(c)) {
                        flag = true;

                    }
                    if ((!f && !flag) || (!f && flag)){
                        System.out.print("NO");
                    }
                     if ((f) || (f && !flag)){
                         System.out.print("YES\n" + m);

                     }
                }
            }
        }
    }

import java.util.Scanner;

public class MessageError {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String src = in.nextLine();
		in.close();
		int lastIndex = 1;
		int index = 0;
		index = src.indexOf(src.charAt(0) + "", lastIndex);
		while (index >= 0 && index < src.length()) {
			String s2 = src.substring(index, src.length());
			index = src.indexOf(src.charAt(0) + "", lastIndex);
			lastIndex = index + 1;
			if (src.startsWith(s2)) {
				System.out.println("YES");
				System.out.println(s2);
				System.exit(0);
			}
		}
		System.out.println("NO");

	}

}