import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.nextLine());

//        sc.nextLine();
        String[] texts = new String[N];
        for (int n = 0; n < N; n++) {
            texts[n] = sc.nextLine();
        }

        HashMap<String, Integer> words = new HashMap<String, Integer>();
//        System.out.println("\n\n"+N);
        int max = 0;
        for (int n = 0; n < N; n++) {
            if (!words.keySet().contains(texts[n])){
                words.put(texts[n], 1);
            } else {
                words.put(texts[n], words.get(texts[n]) + 1);
            }

            if (max < words.get(texts[n])) max = words.get(texts[n]);
//            System.out.println(texts[n]);
//            words.add(texts[n]);
        }

        List<String> maxz = new ArrayList<String>();
//        System.out.println(max);

        for (String w:words.keySet()){
//            System.out.println(w+" "+words.get(w));
            if (max == words.get(w)){
                maxz.add(w);
            }
        }

//        List<String> sortedList = maxz.stream().sorted(Comparator.naturalOrder()).collect(Collectors.toList());
        Collections.sort(maxz);
        for (String i: maxz){
            System.out.println(i);
        }

    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.nextLine());

//        sc.nextLine();
        String[] texts = new String[N];
        for (int n = 0; n < N; n++) {
            texts[n] = sc.nextLine();
        }

        HashMap<String, Integer> words = new HashMap<String, Integer>();
//        System.out.println("\n\n"+N);
        int max = 0;
        for (int n = 0; n < N; n++) {
            if (!words.keySet().contains(texts[n])){
                words.put(texts[n], 1);
            } else {
                words.put(texts[n], words.get(texts[n]) + 1);
            }

            if (max < words.get(texts[n])) max = words.get(texts[n]);
//            System.out.println(texts[n]);
//            words.add(texts[n]);
        }

        List<String> maxz = new ArrayList<String>();
//        System.out.println(max);

        for (String w:words.keySet()){
//            System.out.println(w+" "+words.get(w));
            if (max == words.get(w)){
                maxz.add(w);
            }
        }

//        List<String> sortedList = maxz.stream().sorted(Comparator.naturalOrder()).collect(Collectors.toList());
        Collections.sort(maxz);
        for (String i: maxz){
            System.out.println(i);
        }

    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.nextLine());

//        sc.nextLine();
        String[] texts = new String[N];
        for (int n = 0; n < N; n++) {
            texts[n] = sc.nextLine();
        }

        HashMap<String, Integer> words = new HashMap<String, Integer>();
//        System.out.println("\n\n"+N);
        int max = 0;
        for (int n = 0; n < N; n++) {
            if (!words.keySet().contains(texts[n])){
                words.put(texts[n], 1);
            } else {
                words.put(texts[n], words.get(texts[n]) + 1);
            }

            if (max < words.get(texts[n])) max = words.get(texts[n]);
//            System.out.println(texts[n]);
//            words.add(texts[n]);
        }

        List<String> maxz = new ArrayList<String>();
//        System.out.println(max);

        for (String w:words.keySet()){
//            System.out.println(w+" "+words.get(w));
            if (max == words.get(w)){
                maxz.add(w);
            }
        }

//        List<String> sortedList = maxz.stream().sorted(Comparator.naturalOrder()).collect(Collectors.toList());
        Collections.sort(maxz);
        for (String i: maxz){
            System.out.println(i);
        }

    } main {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.nextLine());

//        sc.nextLine();
        String[] texts = new String[N];
        for (int n = 0; n < N; n++) {
            texts[n] = sc.nextLine();
        }

        HashMap<String, Integer> words = new HashMap<String, Integer>();
//        System.out.println("\n\n"+N);
        int max = 0;
        for (int n = 0; n < N; n++) {
            if (!words.keySet().contains(texts[n])){
                words.put(texts[n], 1);
            } else {
                words.put(texts[n], words.get(texts[n]) + 1);
            }

            if (max < words.get(texts[n])) max = words.get(texts[n]);
//            System.out.println(texts[n]);
//            words.add(texts[n]);
        }

        List<String> maxz = new ArrayList<String>();
//        System.out.println(max);

        for (String w:words.keySet()){
//            System.out.println(w+" "+words.get(w));
            if (max == words.get(w)){
                maxz.add(w);
            }
        }

//        List<String> sortedList = maxz.stream().sorted(Comparator.naturalOrder()).collect(Collectors.toList());
        Collections.sort(maxz);
        for (String i: maxz){
            System.out.println(i);
        }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.nextLine()); N Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc String[] texts = new String[N]; texts new String[N] N for (int n = 0; n < N; n++) {
            texts[n] = sc.nextLine();
        } int n = 0; int n = 0; n 0 n < N n N n++ n++ n {
            texts[n] = sc.nextLine();
        } {
            texts[n] = sc.nextLine();
        } texts[n] = sc.nextLine() texts[n] texts n sc.nextLine() sc.nextLine sc HashMap<String, Integer> words = new HashMap<String, Integer>(); words new HashMap<String, Integer>() int max = 0; max 0 for (int n = 0; n < N; n++) {
            if (!words.keySet().contains(texts[n])){
                words.put(texts[n], 1);
            } else {
                words.put(texts[n], words.get(texts[n]) + 1);
            }

            if (max < words.get(texts[n])) max = words.get(texts[n]);
//            System.out.println(texts[n]);
//            words.add(texts[n]);
        } int n = 0; int n = 0; n 0 n < N n N n++ n++ n {
            if (!words.keySet().contains(texts[n])){
                words.put(texts[n], 1);
            } else {
                words.put(texts[n], words.get(texts[n]) + 1);
            }

            if (max < words.get(texts[n])) max = words.get(texts[n]);
//            System.out.println(texts[n]);
//            words.add(texts[n]);
        } {
            if (!words.keySet().contains(texts[n])){
                words.put(texts[n], 1);
            } else {
                words.put(texts[n], words.get(texts[n]) + 1);
            }

            if (max < words.get(texts[n])) max = words.get(texts[n]);
//            System.out.println(texts[n]);
//            words.add(texts[n]);
        } if (!words.keySet().contains(texts[n])){
                words.put(texts[n], 1);
            } else {
                words.put(texts[n], words.get(texts[n]) + 1);
            } !words.keySet().contains(texts[n]) words.keySet().contains(texts[n]) words.keySet().contains words.keySet() words.keySet words texts[n] texts n {
                words.put(texts[n], 1);
            } words.put(texts[n], 1) words.put words texts[n] texts n 1 {
                words.put(texts[n], words.get(texts[n]) + 1);
            } words.put(texts[n], words.get(texts[n]) + 1) words.put words texts[n] texts n words.get(texts[n]) + 1 words.get(texts[n]) words.get words texts[n] texts n 1 if (max < words.get(texts[n])) max = words.get(texts[n]); max < words.get(texts[n]) max words.get(texts[n]) words.get words texts[n] texts n max = words.get(texts[n]) max words.get(texts[n]) words.get words texts[n] texts n List<String> maxz = new ArrayList<String>(); maxz new ArrayList<String>() for (String w:words.keySet()){
//            System.out.println(w+" "+words.get(w));
            if (max == words.get(w)){
                maxz.add(w);
            }
        } String w words.keySet() words.keySet words {
//            System.out.println(w+" "+words.get(w));
            if (max == words.get(w)){
                maxz.add(w);
            }
        } {
//            System.out.println(w+" "+words.get(w));
            if (max == words.get(w)){
                maxz.add(w);
            }
        } if (max == words.get(w)){
                maxz.add(w);
            } max == words.get(w) max words.get(w) words.get words w {
                maxz.add(w);
            } maxz.add(w) maxz.add maxz w Collections.sort(maxz) Collections.sort Collections maxz for (String i: maxz){
            System.out.println(i);
        } String i maxz {
            System.out.println(i);
        } {
            System.out.println(i);
        } System.out.println(i) System.out.println System.out System System.out i String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.nextLine());

//        sc.nextLine();
        String[] texts = new String[N];
        for (int n = 0; n < N; n++) {
            texts[n] = sc.nextLine();
        }

        HashMap<String, Integer> words = new HashMap<String, Integer>();
//        System.out.println("\n\n"+N);
        int max = 0;
        for (int n = 0; n < N; n++) {
            if (!words.keySet().contains(texts[n])){
                words.put(texts[n], 1);
            } else {
                words.put(texts[n], words.get(texts[n]) + 1);
            }

            if (max < words.get(texts[n])) max = words.get(texts[n]);
//            System.out.println(texts[n]);
//            words.add(texts[n]);
        }

        List<String> maxz = new ArrayList<String>();
//        System.out.println(max);

        for (String w:words.keySet()){
//            System.out.println(w+" "+words.get(w));
            if (max == words.get(w)){
                maxz.add(w);
            }
        }

//        List<String> sortedList = maxz.stream().sorted(Comparator.naturalOrder()).collect(Collectors.toList());
        Collections.sort(maxz);
        for (String i: maxz){
            System.out.println(i);
        }

    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.nextLine());

//        sc.nextLine();
        String[] texts = new String[N];
        for (int n = 0; n < N; n++) {
            texts[n] = sc.nextLine();
        }

        HashMap<String, Integer> words = new HashMap<String, Integer>();
//        System.out.println("\n\n"+N);
        int max = 0;
        for (int n = 0; n < N; n++) {
            if (!words.keySet().contains(texts[n])){
                words.put(texts[n], 1);
            } else {
                words.put(texts[n], words.get(texts[n]) + 1);
            }

            if (max < words.get(texts[n])) max = words.get(texts[n]);
//            System.out.println(texts[n]);
//            words.add(texts[n]);
        }

        List<String> maxz = new ArrayList<String>();
//        System.out.println(max);

        for (String w:words.keySet()){
//            System.out.println(w+" "+words.get(w));
            if (max == words.get(w)){
                maxz.add(w);
            }
        }

//        List<String> sortedList = maxz.stream().sorted(Comparator.naturalOrder()).collect(Collectors.toList());
        Collections.sort(maxz);
        for (String i: maxz){
            System.out.println(i);
        }

    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.nextLine());

//        sc.nextLine();
        String[] texts = new String[N];
        for (int n = 0; n < N; n++) {
            texts[n] = sc.nextLine();
        }

        HashMap<String, Integer> words = new HashMap<String, Integer>();
//        System.out.println("\n\n"+N);
        int max = 0;
        for (int n = 0; n < N; n++) {
            if (!words.keySet().contains(texts[n])){
                words.put(texts[n], 1);
            } else {
                words.put(texts[n], words.get(texts[n]) + 1);
            }

            if (max < words.get(texts[n])) max = words.get(texts[n]);
//            System.out.println(texts[n]);
//            words.add(texts[n]);
        }

        List<String> maxz = new ArrayList<String>();
//        System.out.println(max);

        for (String w:words.keySet()){
//            System.out.println(w+" "+words.get(w));
            if (max == words.get(w)){
                maxz.add(w);
            }
        }

//        List<String> sortedList = maxz.stream().sorted(Comparator.naturalOrder()).collect(Collectors.toList());
        Collections.sort(maxz);
        for (String i: maxz){
            System.out.println(i);
        }

    }
}