
import java.util.*;

public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<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 ans = 0;
        for (Map.Entry<String, Integer> entry: map.entrySet()) {
            ans = Math.max(ans, entry.getValue());
        }

        ArrayList<String> o = new ArrayList<>();
        for (Map.Entry<String, Integer> entry: map.entrySet()) {
            if (ans == entry.getValue()) {
                o.add(entry.getKey());
            }
        }
        Collections.sort(o);

        for (String s: o) {
            System.out.println(s);
        }
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }

} import java.util.*; util.* java public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<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 ans = 0;
        for (Map.Entry<String, Integer> entry: map.entrySet()) {
            ans = Math.max(ans, entry.getValue());
        }

        ArrayList<String> o = new ArrayList<>();
        for (Map.Entry<String, Integer> entry: map.entrySet()) {
            if (ans == entry.getValue()) {
                o.add(entry.getKey());
            }
        }
        Collections.sort(o);

        for (String s: o) {
            System.out.println(s);
        }
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }

} Main void run() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<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 ans = 0;
        for (Map.Entry<String, Integer> entry: map.entrySet()) {
            ans = Math.max(ans, entry.getValue());
        }

        ArrayList<String> o = new ArrayList<>();
        for (Map.Entry<String, Integer> entry: map.entrySet()) {
            if (ans == entry.getValue()) {
                o.add(entry.getKey());
            }
        }
        Collections.sort(o);

        for (String s: o) {
            System.out.println(s);
        }
    } run {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<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 ans = 0;
        for (Map.Entry<String, Integer> entry: map.entrySet()) {
            ans = Math.max(ans, entry.getValue());
        }

        ArrayList<String> o = new ArrayList<>();
        for (Map.Entry<String, Integer> entry: map.entrySet()) {
            if (ans == entry.getValue()) {
                o.add(entry.getKey());
            }
        }
        Collections.sort(o);

        for (String s: o) {
            System.out.println(s);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc HashMap<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 ans = 0; ans 0 for (Map.Entry<String, Integer> entry: map.entrySet()) {
            ans = Math.max(ans, entry.getValue());
        } Map.Entry<String, Integer> entry map.entrySet() map.entrySet map {
            ans = Math.max(ans, entry.getValue());
        } {
            ans = Math.max(ans, entry.getValue());
        } ans = Math.max(ans, entry.getValue()) ans Math.max(ans, entry.getValue()) Math.max Math ans entry.getValue() entry.getValue entry ArrayList<String> o = new ArrayList<>(); o new ArrayList<>() for (Map.Entry<String, Integer> entry: map.entrySet()) {
            if (ans == entry.getValue()) {
                o.add(entry.getKey());
            }
        } Map.Entry<String, Integer> entry map.entrySet() map.entrySet map {
            if (ans == entry.getValue()) {
                o.add(entry.getKey());
            }
        } {
            if (ans == entry.getValue()) {
                o.add(entry.getKey());
            }
        } if (ans == entry.getValue()) {
                o.add(entry.getKey());
            } ans == entry.getValue() ans entry.getValue() entry.getValue entry {
                o.add(entry.getKey());
            } o.add(entry.getKey()) o.add o entry.getKey() entry.getKey entry Collections.sort(o) Collections.sort Collections o for (String s: o) {
            System.out.println(s);
        } String s o {
            System.out.println(s);
        } {
            System.out.println(s);
        } System.out.println(s) System.out.println System.out System System.out s void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    } debug {
        System.err.println(Arrays.deepToString(os));
    } System.err.println(Arrays.deepToString(os)) System.err.println System.err System System.err Arrays.deepToString(os) Arrays.deepToString Arrays os Object... os os public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<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 ans = 0;
        for (Map.Entry<String, Integer> entry: map.entrySet()) {
            ans = Math.max(ans, entry.getValue());
        }

        ArrayList<String> o = new ArrayList<>();
        for (Map.Entry<String, Integer> entry: map.entrySet()) {
            if (ans == entry.getValue()) {
                o.add(entry.getKey());
            }
        }
        Collections.sort(o);

        for (String s: o) {
            System.out.println(s);
        }
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }

} public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<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 ans = 0;
        for (Map.Entry<String, Integer> entry: map.entrySet()) {
            ans = Math.max(ans, entry.getValue());
        }

        ArrayList<String> o = new ArrayList<>();
        for (Map.Entry<String, Integer> entry: map.entrySet()) {
            if (ans == entry.getValue()) {
                o.add(entry.getKey());
            }
        }
        Collections.sort(o);

        for (String s: o) {
            System.out.println(s);
        }
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }

} Main

import java.util.*;

public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<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 ans = 0;
        for (Map.Entry<String, Integer> entry: map.entrySet()) {
            ans = Math.max(ans, entry.getValue());
        }

        ArrayList<String> o = new ArrayList<>();
        for (Map.Entry<String, Integer> entry: map.entrySet()) {
            if (ans == entry.getValue()) {
                o.add(entry.getKey());
            }
        }
        Collections.sort(o);

        for (String s: o) {
            System.out.println(s);
        }
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }

}
