import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < N; i++) {
            String S = sc.next();
            map.put(S, map.getOrDefault(S, 0)+1);
        }
        int max = 0;
        for (int c : map.values()) {
            max = Math.max(max, c);
        }

        List<String> list = new ArrayList<>();
        for (Map.Entry<String, Integer> e : map.entrySet()) {
            String s = e.getKey();
            int c = e.getValue();
            if (c == max) {
                list.add(s);
            }
        }

        Collections.sort(list);
        StringBuilder ans = new StringBuilder();
        for (String l : list) {
            ans.append(l).append('\n');
        }

        System.out.print(ans);
    }
}
 import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < N; i++) {
            String S = sc.next();
            map.put(S, map.getOrDefault(S, 0)+1);
        }
        int max = 0;
        for (int c : map.values()) {
            max = Math.max(max, c);
        }

        List<String> list = new ArrayList<>();
        for (Map.Entry<String, Integer> e : map.entrySet()) {
            String s = e.getKey();
            int c = e.getValue();
            if (c == max) {
                list.add(s);
            }
        }

        Collections.sort(list);
        StringBuilder ans = new StringBuilder();
        for (String l : list) {
            ans.append(l).append('\n');
        }

        System.out.print(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < N; i++) {
            String S = sc.next();
            map.put(S, map.getOrDefault(S, 0)+1);
        }
        int max = 0;
        for (int c : map.values()) {
            max = Math.max(max, c);
        }

        List<String> list = new ArrayList<>();
        for (Map.Entry<String, Integer> e : map.entrySet()) {
            String s = e.getKey();
            int c = e.getValue();
            if (c == max) {
                list.add(s);
            }
        }

        Collections.sort(list);
        StringBuilder ans = new StringBuilder();
        for (String l : list) {
            ans.append(l).append('\n');
        }

        System.out.print(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < N; i++) {
            String S = sc.next();
            map.put(S, map.getOrDefault(S, 0)+1);
        }
        int max = 0;
        for (int c : map.values()) {
            max = Math.max(max, c);
        }

        List<String> list = new ArrayList<>();
        for (Map.Entry<String, Integer> e : map.entrySet()) {
            String s = e.getKey();
            int c = e.getValue();
            if (c == max) {
                list.add(s);
            }
        }

        Collections.sort(list);
        StringBuilder ans = new StringBuilder();
        for (String l : list) {
            ans.append(l).append('\n');
        }

        System.out.print(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc Map<String, Integer> map = new HashMap<>(); map new HashMap<>() for (int i = 0; i < N; i++) {
            String S = sc.next();
            map.put(S, map.getOrDefault(S, 0)+1);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            String S = sc.next();
            map.put(S, map.getOrDefault(S, 0)+1);
        } {
            String S = sc.next();
            map.put(S, map.getOrDefault(S, 0)+1);
        } String S = sc.next(); S sc.next() sc.next sc map.put(S, map.getOrDefault(S, 0)+1) map.put map S map.getOrDefault(S, 0)+1 map.getOrDefault(S, 0) map.getOrDefault map S 0 1 int max = 0; max 0 for (int c : map.values()) {
            max = Math.max(max, c);
        } int c map.values() map.values map {
            max = Math.max(max, c);
        } {
            max = Math.max(max, c);
        } max = Math.max(max, c) max Math.max(max, c) Math.max Math max c List<String> list = new ArrayList<>(); list new ArrayList<>() for (Map.Entry<String, Integer> e : map.entrySet()) {
            String s = e.getKey();
            int c = e.getValue();
            if (c == max) {
                list.add(s);
            }
        } Map.Entry<String, Integer> e map.entrySet() map.entrySet map {
            String s = e.getKey();
            int c = e.getValue();
            if (c == max) {
                list.add(s);
            }
        } {
            String s = e.getKey();
            int c = e.getValue();
            if (c == max) {
                list.add(s);
            }
        } String s = e.getKey(); s e.getKey() e.getKey e int c = e.getValue(); c e.getValue() e.getValue e if (c == max) {
                list.add(s);
            } c == max c max {
                list.add(s);
            } list.add(s) list.add list s Collections.sort(list) Collections.sort Collections list StringBuilder ans = new StringBuilder(); ans new StringBuilder() for (String l : list) {
            ans.append(l).append('\n');
        } String l list {
            ans.append(l).append('\n');
        } {
            ans.append(l).append('\n');
        } ans.append(l).append('\n') ans.append(l).append ans.append(l) ans.append ans l '\n' System.out.print(ans) System.out.print System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < N; i++) {
            String S = sc.next();
            map.put(S, map.getOrDefault(S, 0)+1);
        }
        int max = 0;
        for (int c : map.values()) {
            max = Math.max(max, c);
        }

        List<String> list = new ArrayList<>();
        for (Map.Entry<String, Integer> e : map.entrySet()) {
            String s = e.getKey();
            int c = e.getValue();
            if (c == max) {
                list.add(s);
            }
        }

        Collections.sort(list);
        StringBuilder ans = new StringBuilder();
        for (String l : list) {
            ans.append(l).append('\n');
        }

        System.out.print(ans);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < N; i++) {
            String S = sc.next();
            map.put(S, map.getOrDefault(S, 0)+1);
        }
        int max = 0;
        for (int c : map.values()) {
            max = Math.max(max, c);
        }

        List<String> list = new ArrayList<>();
        for (Map.Entry<String, Integer> e : map.entrySet()) {
            String s = e.getKey();
            int c = e.getValue();
            if (c == max) {
                list.add(s);
            }
        }

        Collections.sort(list);
        StringBuilder ans = new StringBuilder();
        for (String l : list) {
            ans.append(l).append('\n');
        }

        System.out.print(ans);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < N; i++) {
            String S = sc.next();
            map.put(S, map.getOrDefault(S, 0)+1);
        }
        int max = 0;
        for (int c : map.values()) {
            max = Math.max(max, c);
        }

        List<String> list = new ArrayList<>();
        for (Map.Entry<String, Integer> e : map.entrySet()) {
            String s = e.getKey();
            int c = e.getValue();
            if (c == max) {
                list.add(s);
            }
        }

        Collections.sort(list);
        StringBuilder ans = new StringBuilder();
        for (String l : list) {
            ans.append(l).append('\n');
        }

        System.out.print(ans);
    }
}

