import java.util.*;

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

class Solver {

    public void run() {
        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();
        }

        HashMap<String, Integer> m = new HashMap<String, Integer>();
        for (int i = 0; i < N; i++) {
            String s = S[i];
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        }

        int max = 0;
        Set<String> set = new TreeSet<String>();
        for (Map.Entry e : m.entrySet()) {
            int cnt = (int) e.getValue();
            if (max < cnt) {
                set.clear();
                max = cnt;
            }
            if (max == cnt) {
                set.add((String)e.getKey());
            }
        }

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

        return;
    }

} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
} Main public static void main(String[] args) {
        new Solver().run();
    } main {
        new Solver().run();
    } new Solver().run() new Solver().run new Solver() String[] args args class Solver {

    public void run() {
        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();
        }

        HashMap<String, Integer> m = new HashMap<String, Integer>();
        for (int i = 0; i < N; i++) {
            String s = S[i];
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        }

        int max = 0;
        Set<String> set = new TreeSet<String>();
        for (Map.Entry e : m.entrySet()) {
            int cnt = (int) e.getValue();
            if (max < cnt) {
                set.clear();
                max = cnt;
            }
            if (max == cnt) {
                set.add((String)e.getKey());
            }
        }

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

        return;
    }

} Solver public void run() {
        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();
        }

        HashMap<String, Integer> m = new HashMap<String, Integer>();
        for (int i = 0; i < N; i++) {
            String s = S[i];
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        }

        int max = 0;
        Set<String> set = new TreeSet<String>();
        for (Map.Entry e : m.entrySet()) {
            int cnt = (int) e.getValue();
            if (max < cnt) {
                set.clear();
                max = cnt;
            }
            if (max == cnt) {
                set.add((String)e.getKey());
            }
        }

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

        return;
    } run {
        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();
        }

        HashMap<String, Integer> m = new HashMap<String, Integer>();
        for (int i = 0; i < N; i++) {
            String s = S[i];
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        }

        int max = 0;
        Set<String> set = new TreeSet<String>();
        for (Map.Entry e : m.entrySet()) {
            int cnt = (int) e.getValue();
            if (max < cnt) {
                set.clear();
                max = cnt;
            }
            if (max == cnt) {
                set.add((String)e.getKey());
            }
        }

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

        return;
    } 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 HashMap<String, Integer> m = new HashMap<String, Integer>(); m new HashMap<String, Integer>() for (int i = 0; i < N; i++) {
            String s = S[i];
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            String s = S[i];
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        } {
            String s = S[i];
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        } String s = S[i]; s S[i] S i if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            } m.containsKey(s) m.containsKey m s {
                m.put(s, m.get(s) + 1);
            } m.put(s, m.get(s) + 1) m.put m s m.get(s) + 1 m.get(s) m.get m s 1 {
                m.put(s, 1);
            } m.put(s, 1) m.put m s 1 int max = 0; max 0 Set<String> set = new TreeSet<String>(); set new TreeSet<String>() for (Map.Entry e : m.entrySet()) {
            int cnt = (int) e.getValue();
            if (max < cnt) {
                set.clear();
                max = cnt;
            }
            if (max == cnt) {
                set.add((String)e.getKey());
            }
        } Map.Entry e m.entrySet() m.entrySet m {
            int cnt = (int) e.getValue();
            if (max < cnt) {
                set.clear();
                max = cnt;
            }
            if (max == cnt) {
                set.add((String)e.getKey());
            }
        } {
            int cnt = (int) e.getValue();
            if (max < cnt) {
                set.clear();
                max = cnt;
            }
            if (max == cnt) {
                set.add((String)e.getKey());
            }
        } int cnt = (int) e.getValue(); cnt (int) e.getValue() e.getValue e if (max < cnt) {
                set.clear();
                max = cnt;
            } max < cnt max cnt {
                set.clear();
                max = cnt;
            } set.clear() set.clear set max = cnt max cnt if (max == cnt) {
                set.add((String)e.getKey());
            } max == cnt max cnt {
                set.add((String)e.getKey());
            } set.add((String)e.getKey()) set.add set (String)e.getKey() e.getKey e for (String s : set) {
            System.out.println(s);
        } String s set {
            System.out.println(s);
        } {
            System.out.println(s);
        } System.out.println(s) System.out.println System.out System System.out s return;
import java.util.*;

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

class Solver {

    public void run() {
        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();
        }

        HashMap<String, Integer> m = new HashMap<String, Integer>();
        for (int i = 0; i < N; i++) {
            String s = S[i];
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        }

        int max = 0;
        Set<String> set = new TreeSet<String>();
        for (Map.Entry e : m.entrySet()) {
            int cnt = (int) e.getValue();
            if (max < cnt) {
                set.clear();
                max = cnt;
            }
            if (max == cnt) {
                set.add((String)e.getKey());
            }
        }

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

        return;
    }

}
