package com.javarush.task.task18.task1803;

import java.io.*;
import java.util.HashMap;
import java.util.Map;

/*
Самые частые байты
*/

public class Solution {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        FileInputStream fis = new FileInputStream(br.readLine());
        HashMap <Integer, Integer> map  = new HashMap<>();
        int maxRep = 0;
        int count = 0;
            while (fis.available() > 0) {
                try {
                    int a = fis.read();
                    map.put(a, count++);
                    if (map.get(count) > maxRep) {
                        maxRep = map.get(count);
                    }
                } catch (NullPointerException e) {}
            }

        for (Map.Entry entry : map.entrySet()) {
             if ((Integer)entry.getValue() == maxRep) {
                 System.out.println(entry.getKey() + " ");
             }
        }

        fis.close();
        br.close();
    }
}