public class Solution {
    private static List<String> strings;

    public static void main(String[] args) throws Exception {
        //write your code here
        strings = new ArrayList<String>();

        for (int i = 0; i < 5; i++){
            BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
            strings.add(reader.readLine());
        }

        int longest = strings.get(0).length();

        for (int i = 1; i <= strings.size(); i++){
            for (int j = 1; j <= strings.size(); j++){
                if (longest < strings.get(j).length())
                    longest = strings.get(j).length();
            }
        }

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

    }
}