
import java.util.*;

public class Main {
    private static final int MOD = 1_000_000_007;
    private static final String YES = "Yes";
    private static final String NO = "No";

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

        int N = sc.nextInt();
        String[] S = new String[N];
        for (int i=0; i<N; i++) {
            S[i] = sc.next();
        }

        String[] ans = solve(N, S);
        for (int i=0; i<ans.length; i++) {
            System.out.println(ans[i]);
        }
    }

    private static String[] solve(int N, String[] S) {
        Map<String, Integer> map = new HashMap();
        int most = 0;

        for (int i=0; i<N; i++) {
            String key = S[i];
            int count = 0;

            if (map.containsKey(key)) {
                count = (Integer)map.get(key);
                map.put(key, (count+1));
            } else {
                map.put(key, 1);
            }

            most = Math.max(most, count+1);
        }

        List<String> ans = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            // System.err.println(entry.getKey() + ":" + entry.getValue());
            if (entry.getValue() == most) {
                ans.add(entry.getKey());
            }
        }


        Collections.sort(ans);

        return ans.toArray(new String[0]);
    }
} import java.util.*; util.* java public class Main {
    private static final int MOD = 1_000_000_007;
    private static final String YES = "Yes";
    private static final String NO = "No";

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

        int N = sc.nextInt();
        String[] S = new String[N];
        for (int i=0; i<N; i++) {
            S[i] = sc.next();
        }

        String[] ans = solve(N, S);
        for (int i=0; i<ans.length; i++) {
            System.out.println(ans[i]);
        }
    }

    private static String[] solve(int N, String[] S) {
        Map<String, Integer> map = new HashMap();
        int most = 0;

        for (int i=0; i<N; i++) {
            String key = S[i];
            int count = 0;

            if (map.containsKey(key)) {
                count = (Integer)map.get(key);
                map.put(key, (count+1));
            } else {
                map.put(key, 1);
            }

            most = Math.max(most, count+1);
        }

        List<String> ans = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            // System.err.println(entry.getKey() + ":" + entry.getValue());
            if (entry.getValue() == most) {
                ans.add(entry.getKey());
            }
        }


        Collections.sort(ans);

        return ans.toArray(new String[0]);
    }
} Main private static final int MOD = 1_000_000_007; MOD 1_000_000_007 private static final String YES = "Yes"; YES "Yes" private static final String NO = "No"; NO "No" public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        String[] S = new String[N];
        for (int i=0; i<N; i++) {
            S[i] = sc.next();
        }

        String[] ans = solve(N, S);
        for (int i=0; i<ans.length; i++) {
            System.out.println(ans[i]);
        }
    } main {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        String[] S = new String[N];
        for (int i=0; i<N; i++) {
            S[i] = sc.next();
        }

        String[] ans = solve(N, S);
        for (int i=0; i<ans.length; i++) {
            System.out.println(ans[i]);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc String[] S = new String[N]; S new String[N] N for (int i=0; i<N; i++) {
            S[i] = sc.next();
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            S[i] = sc.next();
        } {
            S[i] = sc.next();
        } S[i] = sc.next() S[i] S i sc.next() sc.next sc String[] ans = solve(N, S); ans solve(N, S) solve N S for (int i=0; i<ans.length; i++) {
            System.out.println(ans[i]);
        } int i=0; int i=0; i 0 i<ans.length i ans.length ans ans.length i++ i++ i {
            System.out.println(ans[i]);
        } {
            System.out.println(ans[i]);
        } System.out.println(ans[i]) System.out.println System.out System System.out ans[i] ans i String[] args args private static String[] solve(int N, String[] S) {
        Map<String, Integer> map = new HashMap();
        int most = 0;

        for (int i=0; i<N; i++) {
            String key = S[i];
            int count = 0;

            if (map.containsKey(key)) {
                count = (Integer)map.get(key);
                map.put(key, (count+1));
            } else {
                map.put(key, 1);
            }

            most = Math.max(most, count+1);
        }

        List<String> ans = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            // System.err.println(entry.getKey() + ":" + entry.getValue());
            if (entry.getValue() == most) {
                ans.add(entry.getKey());
            }
        }


        Collections.sort(ans);

        return ans.toArray(new String[0]);
    } solve {
        Map<String, Integer> map = new HashMap();
        int most = 0;

        for (int i=0; i<N; i++) {
            String key = S[i];
            int count = 0;

            if (map.containsKey(key)) {
                count = (Integer)map.get(key);
                map.put(key, (count+1));
            } else {
                map.put(key, 1);
            }

            most = Math.max(most, count+1);
        }

        List<String> ans = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            // System.err.println(entry.getKey() + ":" + entry.getValue());
            if (entry.getValue() == most) {
                ans.add(entry.getKey());
            }
        }


        Collections.sort(ans);

        return ans.toArray(new String[0]);
    } Map<String, Integer> map = new HashMap(); map new HashMap() int most = 0; most 0 for (int i=0; i<N; i++) {
            String key = S[i];
            int count = 0;

            if (map.containsKey(key)) {
                count = (Integer)map.get(key);
                map.put(key, (count+1));
            } else {
                map.put(key, 1);
            }

            most = Math.max(most, count+1);
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            String key = S[i];
            int count = 0;

            if (map.containsKey(key)) {
                count = (Integer)map.get(key);
                map.put(key, (count+1));
            } else {
                map.put(key, 1);
            }

            most = Math.max(most, count+1);
        } {
            String key = S[i];
            int count = 0;

            if (map.containsKey(key)) {
                count = (Integer)map.get(key);
                map.put(key, (count+1));
            } else {
                map.put(key, 1);
            }

            most = Math.max(most, count+1);
        } String key = S[i]; key S[i] S i int count = 0; count 0 if (map.containsKey(key)) {
                count = (Integer)map.get(key);
                map.put(key, (count+1));
            } else {
                map.put(key, 1);
            } map.containsKey(key) map.containsKey map key {
                count = (Integer)map.get(key);
                map.put(key, (count+1));
            } count = (Integer)map.get(key) count (Integer)map.get(key) map.get map key map.put(key, (count+1)) map.put map key (count+1) count 1 {
                map.put(key, 1);
            } map.put(key, 1) map.put map key 1 most = Math.max(most, count+1) most Math.max(most, count+1) Math.max Math most count+1 count 1 List<String> ans = new ArrayList<>(); ans new ArrayList<>() for (Map.Entry<String, Integer> entry : map.entrySet()) {
            // System.err.println(entry.getKey() + ":" + entry.getValue());
            if (entry.getValue() == most) {
                ans.add(entry.getKey());
            }
        } Map.Entry<String, Integer> entry map.entrySet() map.entrySet map {
            // System.err.println(entry.getKey() + ":" + entry.getValue());
            if (entry.getValue() == most) {
                ans.add(entry.getKey());
            }
        } {
            // System.err.println(entry.getKey() + ":" + entry.getValue());
            if (entry.getValue() == most) {
                ans.add(entry.getKey());
            }
        } if (entry.getValue() == most) {
                ans.add(entry.getKey());
            } entry.getValue() == most entry.getValue() entry.getValue entry most {
                ans.add(entry.getKey());
            } ans.add(entry.getKey()) ans.add ans entry.getKey() entry.getKey entry Collections.sort(ans) Collections.sort Collections ans return ans.toArray(new String[0]); ans.toArray(new String[0]) ans.toArray ans new String[0] 0 int N N String[] S S public class Main {
    private static final int MOD = 1_000_000_007;
    private static final String YES = "Yes";
    private static final String NO = "No";

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

        int N = sc.nextInt();
        String[] S = new String[N];
        for (int i=0; i<N; i++) {
            S[i] = sc.next();
        }

        String[] ans = solve(N, S);
        for (int i=0; i<ans.length; i++) {
            System.out.println(ans[i]);
        }
    }

    private static String[] solve(int N, String[] S) {
        Map<String, Integer> map = new HashMap();
        int most = 0;

        for (int i=0; i<N; i++) {
            String key = S[i];
            int count = 0;

            if (map.containsKey(key)) {
                count = (Integer)map.get(key);
                map.put(key, (count+1));
            } else {
                map.put(key, 1);
            }

            most = Math.max(most, count+1);
        }

        List<String> ans = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            // System.err.println(entry.getKey() + ":" + entry.getValue());
            if (entry.getValue() == most) {
                ans.add(entry.getKey());
            }
        }


        Collections.sort(ans);

        return ans.toArray(new String[0]);
    }
} public class Main {
    private static final int MOD = 1_000_000_007;
    private static final String YES = "Yes";
    private static final String NO = "No";

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

        int N = sc.nextInt();
        String[] S = new String[N];
        for (int i=0; i<N; i++) {
            S[i] = sc.next();
        }

        String[] ans = solve(N, S);
        for (int i=0; i<ans.length; i++) {
            System.out.println(ans[i]);
        }
    }

    private static String[] solve(int N, String[] S) {
        Map<String, Integer> map = new HashMap();
        int most = 0;

        for (int i=0; i<N; i++) {
            String key = S[i];
            int count = 0;

            if (map.containsKey(key)) {
                count = (Integer)map.get(key);
                map.put(key, (count+1));
            } else {
                map.put(key, 1);
            }

            most = Math.max(most, count+1);
        }

        List<String> ans = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            // System.err.println(entry.getKey() + ":" + entry.getValue());
            if (entry.getValue() == most) {
                ans.add(entry.getKey());
            }
        }


        Collections.sort(ans);

        return ans.toArray(new String[0]);
    }
} Main

import java.util.*;

public class Main {
    private static final int MOD = 1_000_000_007;
    private static final String YES = "Yes";
    private static final String NO = "No";

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

        int N = sc.nextInt();
        String[] S = new String[N];
        for (int i=0; i<N; i++) {
            S[i] = sc.next();
        }

        String[] ans = solve(N, S);
        for (int i=0; i<ans.length; i++) {
            System.out.println(ans[i]);
        }
    }

    private static String[] solve(int N, String[] S) {
        Map<String, Integer> map = new HashMap();
        int most = 0;

        for (int i=0; i<N; i++) {
            String key = S[i];
            int count = 0;

            if (map.containsKey(key)) {
                count = (Integer)map.get(key);
                map.put(key, (count+1));
            } else {
                map.put(key, 1);
            }

            most = Math.max(most, count+1);
        }

        List<String> ans = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            // System.err.println(entry.getKey() + ":" + entry.getValue());
            if (entry.getValue() == most) {
                ans.add(entry.getKey());
            }
        }


        Collections.sort(ans);

        return ans.toArray(new String[0]);
    }
}