public class Solution {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String name = reader.readLine();
        FileInputStream fileInputStream = new FileInputStream(name);


        byte[] bytes = new byte[256];

        while (fileInputStream.available() > 0){
            bytes[fileInputStream.read()]++;
        }
        int max = 0;
        for (int i = 0; i < bytes.length; i++){
            if (max < bytes[i]){
                max = bytes[i];
            }
        }
        for (int i = 0; i < bytes.length; i++){
            if ( max == bytes[i]){
                System.out.print(i + " ");
            }
        }
        reader.close();
        fileInputStream.close();

    }
}