public class Solution {
    public static void main(String[] args) throws Exception {
        //напишите тут ваш код
        ArrayList<String> strings = new ArrayList<String>();
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        for(int i = 0;i < 5; i++){
            String s = bf.readLine();
            strings.add(i,s);

        }
        int minLength = 0;
        for(int i = 1;i< strings.size();i++){
            if(strings.get(i-1).length() <= strings.get(i).length()) {
                minLength = strings.get(i - 1).length();
                strings.remove(i);
            }else if(strings.get(i-1).length()> strings.get(i).length()){
                minLength = strings.get(i).length();
              strings.remove(i-1);
            }
        }

        for(int i=0; i<strings.size(); i++) {
            if (minLength == strings.get(i).length())
                System.out.println(strings.get(i));
        }
    }
}