
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        Map<String, Integer> map = new HashMap<>();

        int max = 0;
        for (int i = 0 ; i < N ; i++) {
            String S = scanner.next();
            if (map.containsKey(S)) {
                map.put(S, map.get(S) + 1);

            } else {
                map.put(S, 1);
            }
            max = Math.max(max, map.get(S));
        }

        List<String> stringList = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            if (entry.getValue() == max) {
                stringList.add(entry.getKey());
            }
        }
        Collections.sort(stringList);
        for (String s : stringList) {
            System.out.println(s);
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        Map<String, Integer> map = new HashMap<>();

        int max = 0;
        for (int i = 0 ; i < N ; i++) {
            String S = scanner.next();
            if (map.containsKey(S)) {
                map.put(S, map.get(S) + 1);

            } else {
                map.put(S, 1);
            }
            max = Math.max(max, map.get(S));
        }

        List<String> stringList = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            if (entry.getValue() == max) {
                stringList.add(entry.getKey());
            }
        }
        Collections.sort(stringList);
        for (String s : stringList) {
            System.out.println(s);
        }
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        Map<String, Integer> map = new HashMap<>();

        int max = 0;
        for (int i = 0 ; i < N ; i++) {
            String S = scanner.next();
            if (map.containsKey(S)) {
                map.put(S, map.get(S) + 1);

            } else {
                map.put(S, 1);
            }
            max = Math.max(max, map.get(S));
        }

        List<String> stringList = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            if (entry.getValue() == max) {
                stringList.add(entry.getKey());
            }
        }
        Collections.sort(stringList);
        for (String s : stringList) {
            System.out.println(s);
        }
    } main {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        Map<String, Integer> map = new HashMap<>();

        int max = 0;
        for (int i = 0 ; i < N ; i++) {
            String S = scanner.next();
            if (map.containsKey(S)) {
                map.put(S, map.get(S) + 1);

            } else {
                map.put(S, 1);
            }
            max = Math.max(max, map.get(S));
        }

        List<String> stringList = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            if (entry.getValue() == max) {
                stringList.add(entry.getKey());
            }
        }
        Collections.sort(stringList);
        for (String s : stringList) {
            System.out.println(s);
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner Map<String, Integer> map = new HashMap<>(); map new HashMap<>() int max = 0; max 0 for (int i = 0 ; i < N ; i++) {
            String S = scanner.next();
            if (map.containsKey(S)) {
                map.put(S, map.get(S) + 1);

            } else {
                map.put(S, 1);
            }
            max = Math.max(max, map.get(S));
        } int i = 0 ; int i = 0 ; i 0 i < N i N i++ i++ i {
            String S = scanner.next();
            if (map.containsKey(S)) {
                map.put(S, map.get(S) + 1);

            } else {
                map.put(S, 1);
            }
            max = Math.max(max, map.get(S));
        } {
            String S = scanner.next();
            if (map.containsKey(S)) {
                map.put(S, map.get(S) + 1);

            } else {
                map.put(S, 1);
            }
            max = Math.max(max, map.get(S));
        } String S = scanner.next(); S scanner.next() scanner.next scanner if (map.containsKey(S)) {
                map.put(S, map.get(S) + 1);

            } else {
                map.put(S, 1);
            } map.containsKey(S) map.containsKey map S {
                map.put(S, map.get(S) + 1);

            } map.put(S, map.get(S) + 1) map.put map S map.get(S) + 1 map.get(S) map.get map S 1 {
                map.put(S, 1);
            } map.put(S, 1) map.put map S 1 max = Math.max(max, map.get(S)) max Math.max(max, map.get(S)) Math.max Math max map.get(S) map.get map S List<String> stringList = new ArrayList<>(); stringList new ArrayList<>() for (Map.Entry<String, Integer> entry : map.entrySet()) {
            if (entry.getValue() == max) {
                stringList.add(entry.getKey());
            }
        } Map.Entry<String, Integer> entry map.entrySet() map.entrySet map {
            if (entry.getValue() == max) {
                stringList.add(entry.getKey());
            }
        } {
            if (entry.getValue() == max) {
                stringList.add(entry.getKey());
            }
        } if (entry.getValue() == max) {
                stringList.add(entry.getKey());
            } entry.getValue() == max entry.getValue() entry.getValue entry max {
                stringList.add(entry.getKey());
            } stringList.add(entry.getKey()) stringList.add stringList entry.getKey() entry.getKey entry Collections.sort(stringList) Collections.sort Collections stringList for (String s : stringList) {
            System.out.println(s);
        } String s stringList {
            System.out.println(s);
        } {
            System.out.println(s);
        } System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        Map<String, Integer> map = new HashMap<>();

        int max = 0;
        for (int i = 0 ; i < N ; i++) {
            String S = scanner.next();
            if (map.containsKey(S)) {
                map.put(S, map.get(S) + 1);

            } else {
                map.put(S, 1);
            }
            max = Math.max(max, map.get(S));
        }

        List<String> stringList = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            if (entry.getValue() == max) {
                stringList.add(entry.getKey());
            }
        }
        Collections.sort(stringList);
        for (String s : stringList) {
            System.out.println(s);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        Map<String, Integer> map = new HashMap<>();

        int max = 0;
        for (int i = 0 ; i < N ; i++) {
            String S = scanner.next();
            if (map.containsKey(S)) {
                map.put(S, map.get(S) + 1);

            } else {
                map.put(S, 1);
            }
            max = Math.max(max, map.get(S));
        }

        List<String> stringList = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            if (entry.getValue() == max) {
                stringList.add(entry.getKey());
            }
        }
        Collections.sort(stringList);
        for (String s : stringList) {
            System.out.println(s);
        }
    }
} Main

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        Map<String, Integer> map = new HashMap<>();

        int max = 0;
        for (int i = 0 ; i < N ; i++) {
            String S = scanner.next();
            if (map.containsKey(S)) {
                map.put(S, map.get(S) + 1);

            } else {
                map.put(S, 1);
            }
            max = Math.max(max, map.get(S));
        }

        List<String> stringList = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            if (entry.getValue() == max) {
                stringList.add(entry.getKey());
            }
        }
        Collections.sort(stringList);
        for (String s : stringList) {
            System.out.println(s);
        }
    }
}
