import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] inputs = new String[N];
        Map<String, Integer> treeMap = new TreeMap<>();
        int max = 0;

        for(int i = 0; i < N; i++) {
            inputs[i] = sc.next();
        }

        for(String input: inputs) {
            if(treeMap.containsKey(input)) {
                treeMap.put(input, treeMap.get(input)+1);
                max = Math.max(max,treeMap.get(input));
            } else {
                treeMap.put(input, 1);
                max = Math.max(max,treeMap.get(input));
            }
        }

        for(Map.Entry<String, Integer> entry:treeMap.entrySet()) {
            if(entry.getValue() == max) {
                System.out.println(entry.getKey());
            }
        }

    }
} import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util import java.util.TreeMap; TreeMap java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] inputs = new String[N];
        Map<String, Integer> treeMap = new TreeMap<>();
        int max = 0;

        for(int i = 0; i < N; i++) {
            inputs[i] = sc.next();
        }

        for(String input: inputs) {
            if(treeMap.containsKey(input)) {
                treeMap.put(input, treeMap.get(input)+1);
                max = Math.max(max,treeMap.get(input));
            } else {
                treeMap.put(input, 1);
                max = Math.max(max,treeMap.get(input));
            }
        }

        for(Map.Entry<String, Integer> entry:treeMap.entrySet()) {
            if(entry.getValue() == max) {
                System.out.println(entry.getKey());
            }
        }

    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] inputs = new String[N];
        Map<String, Integer> treeMap = new TreeMap<>();
        int max = 0;

        for(int i = 0; i < N; i++) {
            inputs[i] = sc.next();
        }

        for(String input: inputs) {
            if(treeMap.containsKey(input)) {
                treeMap.put(input, treeMap.get(input)+1);
                max = Math.max(max,treeMap.get(input));
            } else {
                treeMap.put(input, 1);
                max = Math.max(max,treeMap.get(input));
            }
        }

        for(Map.Entry<String, Integer> entry:treeMap.entrySet()) {
            if(entry.getValue() == max) {
                System.out.println(entry.getKey());
            }
        }

    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] inputs = new String[N];
        Map<String, Integer> treeMap = new TreeMap<>();
        int max = 0;

        for(int i = 0; i < N; i++) {
            inputs[i] = sc.next();
        }

        for(String input: inputs) {
            if(treeMap.containsKey(input)) {
                treeMap.put(input, treeMap.get(input)+1);
                max = Math.max(max,treeMap.get(input));
            } else {
                treeMap.put(input, 1);
                max = Math.max(max,treeMap.get(input));
            }
        }

        for(Map.Entry<String, Integer> entry:treeMap.entrySet()) {
            if(entry.getValue() == max) {
                System.out.println(entry.getKey());
            }
        }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc String[] inputs = new String[N]; inputs new String[N] N Map<String, Integer> treeMap = new TreeMap<>(); treeMap new TreeMap<>() int max = 0; max 0 for(int i = 0; i < N; i++) {
            inputs[i] = sc.next();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            inputs[i] = sc.next();
        } {
            inputs[i] = sc.next();
        } inputs[i] = sc.next() inputs[i] inputs i sc.next() sc.next sc for(String input: inputs) {
            if(treeMap.containsKey(input)) {
                treeMap.put(input, treeMap.get(input)+1);
                max = Math.max(max,treeMap.get(input));
            } else {
                treeMap.put(input, 1);
                max = Math.max(max,treeMap.get(input));
            }
        } String input inputs {
            if(treeMap.containsKey(input)) {
                treeMap.put(input, treeMap.get(input)+1);
                max = Math.max(max,treeMap.get(input));
            } else {
                treeMap.put(input, 1);
                max = Math.max(max,treeMap.get(input));
            }
        } {
            if(treeMap.containsKey(input)) {
                treeMap.put(input, treeMap.get(input)+1);
                max = Math.max(max,treeMap.get(input));
            } else {
                treeMap.put(input, 1);
                max = Math.max(max,treeMap.get(input));
            }
        } if(treeMap.containsKey(input)) {
                treeMap.put(input, treeMap.get(input)+1);
                max = Math.max(max,treeMap.get(input));
            } else {
                treeMap.put(input, 1);
                max = Math.max(max,treeMap.get(input));
            } treeMap.containsKey(input) treeMap.containsKey treeMap input {
                treeMap.put(input, treeMap.get(input)+1);
                max = Math.max(max,treeMap.get(input));
            } treeMap.put(input, treeMap.get(input)+1) treeMap.put treeMap input treeMap.get(input)+1 treeMap.get(input) treeMap.get treeMap input 1 max = Math.max(max,treeMap.get(input)) max Math.max(max,treeMap.get(input)) Math.max Math max treeMap.get(input) treeMap.get treeMap input {
                treeMap.put(input, 1);
                max = Math.max(max,treeMap.get(input));
            } treeMap.put(input, 1) treeMap.put treeMap input 1 max = Math.max(max,treeMap.get(input)) max Math.max(max,treeMap.get(input)) Math.max Math max treeMap.get(input) treeMap.get treeMap input for(Map.Entry<String, Integer> entry:treeMap.entrySet()) {
            if(entry.getValue() == max) {
                System.out.println(entry.getKey());
            }
        } Map.Entry<String, Integer> entry treeMap.entrySet() treeMap.entrySet treeMap {
            if(entry.getValue() == max) {
                System.out.println(entry.getKey());
            }
        } {
            if(entry.getValue() == max) {
                System.out.println(entry.getKey());
            }
        } if(entry.getValue() == max) {
                System.out.println(entry.getKey());
            } entry.getValue() == max entry.getValue() entry.getValue entry max {
                System.out.println(entry.getKey());
            } System.out.println(entry.getKey()) System.out.println System.out System System.out entry.getKey() entry.getKey entry String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] inputs = new String[N];
        Map<String, Integer> treeMap = new TreeMap<>();
        int max = 0;

        for(int i = 0; i < N; i++) {
            inputs[i] = sc.next();
        }

        for(String input: inputs) {
            if(treeMap.containsKey(input)) {
                treeMap.put(input, treeMap.get(input)+1);
                max = Math.max(max,treeMap.get(input));
            } else {
                treeMap.put(input, 1);
                max = Math.max(max,treeMap.get(input));
            }
        }

        for(Map.Entry<String, Integer> entry:treeMap.entrySet()) {
            if(entry.getValue() == max) {
                System.out.println(entry.getKey());
            }
        }

    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] inputs = new String[N];
        Map<String, Integer> treeMap = new TreeMap<>();
        int max = 0;

        for(int i = 0; i < N; i++) {
            inputs[i] = sc.next();
        }

        for(String input: inputs) {
            if(treeMap.containsKey(input)) {
                treeMap.put(input, treeMap.get(input)+1);
                max = Math.max(max,treeMap.get(input));
            } else {
                treeMap.put(input, 1);
                max = Math.max(max,treeMap.get(input));
            }
        }

        for(Map.Entry<String, Integer> entry:treeMap.entrySet()) {
            if(entry.getValue() == max) {
                System.out.println(entry.getKey());
            }
        }

    }
} Main
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] inputs = new String[N];
        Map<String, Integer> treeMap = new TreeMap<>();
        int max = 0;

        for(int i = 0; i < N; i++) {
            inputs[i] = sc.next();
        }

        for(String input: inputs) {
            if(treeMap.containsKey(input)) {
                treeMap.put(input, treeMap.get(input)+1);
                max = Math.max(max,treeMap.get(input));
            } else {
                treeMap.put(input, 1);
                max = Math.max(max,treeMap.get(input));
            }
        }

        for(Map.Entry<String, Integer> entry:treeMap.entrySet()) {
            if(entry.getValue() == max) {
                System.out.println(entry.getKey());
            }
        }

    }
}
