import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.HashMap;
import java.util.Collections;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int n = Integer.parseInt(in.next());
            String s[] = new String[n];
            for (int i = 0; i < n; i++) {
                s[i] = in.next();
            }
            Arrays.sort(s);
            Map<String, Integer> m = new HashMap<>();
            int cnt = 0;

            for (int i = 0; i < n; i++) {
                if (m.get(s[i]) == null) {
                    m.put(s[i], 0);
                } else {
                    cnt = m.get(s[i]) + 1;
                    m.put(s[i], cnt);
                }
            }

            List<String> t = new ArrayList<>();
            int tmp = 0;
            for (int i = 0; i < n; i++) {
                tmp = Math.max(tmp, m.get(s[i]));
            }

            for (Map.Entry<String, Integer> e : m.entrySet()) {
                if (tmp == e.getValue()) {
                    t.add(e.getKey());
                }
            }
            Collections.sort(t);
            for (int i = 0; i < t.size(); i++) {
                out.println(t.get(i));
            }
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Arrays; Arrays java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Map.Entry; Entry java.util.Map import java.util.Scanner; Scanner java.util import java.util.HashMap; HashMap java.util import java.util.Collections; Collections java.util import java.util.ArrayList; ArrayList java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int n = Integer.parseInt(in.next());
            String s[] = new String[n];
            for (int i = 0; i < n; i++) {
                s[i] = in.next();
            }
            Arrays.sort(s);
            Map<String, Integer> m = new HashMap<>();
            int cnt = 0;

            for (int i = 0; i < n; i++) {
                if (m.get(s[i]) == null) {
                    m.put(s[i], 0);
                } else {
                    cnt = m.get(s[i]) + 1;
                    m.put(s[i], cnt);
                }
            }

            List<String> t = new ArrayList<>();
            int tmp = 0;
            for (int i = 0; i < n; i++) {
                tmp = Math.max(tmp, m.get(s[i]));
            }

            for (Map.Entry<String, Integer> e : m.entrySet()) {
                if (tmp == e.getValue()) {
                    t.add(e.getKey());
                }
            }
            Collections.sort(t);
            for (int i = 0; i < t.size(); i++) {
                out.println(t.get(i));
            }
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) C solver = new C(); solver new C() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int n = Integer.parseInt(in.next());
            String s[] = new String[n];
            for (int i = 0; i < n; i++) {
                s[i] = in.next();
            }
            Arrays.sort(s);
            Map<String, Integer> m = new HashMap<>();
            int cnt = 0;

            for (int i = 0; i < n; i++) {
                if (m.get(s[i]) == null) {
                    m.put(s[i], 0);
                } else {
                    cnt = m.get(s[i]) + 1;
                    m.put(s[i], cnt);
                }
            }

            List<String> t = new ArrayList<>();
            int tmp = 0;
            for (int i = 0; i < n; i++) {
                tmp = Math.max(tmp, m.get(s[i]));
            }

            for (Map.Entry<String, Integer> e : m.entrySet()) {
                if (tmp == e.getValue()) {
                    t.add(e.getKey());
                }
            }
            Collections.sort(t);
            for (int i = 0; i < t.size(); i++) {
                out.println(t.get(i));
            }
        }

    } C public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int n = Integer.parseInt(in.next());
            String s[] = new String[n];
            for (int i = 0; i < n; i++) {
                s[i] = in.next();
            }
            Arrays.sort(s);
            Map<String, Integer> m = new HashMap<>();
            int cnt = 0;

            for (int i = 0; i < n; i++) {
                if (m.get(s[i]) == null) {
                    m.put(s[i], 0);
                } else {
                    cnt = m.get(s[i]) + 1;
                    m.put(s[i], cnt);
                }
            }

            List<String> t = new ArrayList<>();
            int tmp = 0;
            for (int i = 0; i < n; i++) {
                tmp = Math.max(tmp, m.get(s[i]));
            }

            for (Map.Entry<String, Integer> e : m.entrySet()) {
                if (tmp == e.getValue()) {
                    t.add(e.getKey());
                }
            }
            Collections.sort(t);
            for (int i = 0; i < t.size(); i++) {
                out.println(t.get(i));
            }
        } solve {
            // 入力
            int n = Integer.parseInt(in.next());
            String s[] = new String[n];
            for (int i = 0; i < n; i++) {
                s[i] = in.next();
            }
            Arrays.sort(s);
            Map<String, Integer> m = new HashMap<>();
            int cnt = 0;

            for (int i = 0; i < n; i++) {
                if (m.get(s[i]) == null) {
                    m.put(s[i], 0);
                } else {
                    cnt = m.get(s[i]) + 1;
                    m.put(s[i], cnt);
                }
            }

            List<String> t = new ArrayList<>();
            int tmp = 0;
            for (int i = 0; i < n; i++) {
                tmp = Math.max(tmp, m.get(s[i]));
            }

            for (Map.Entry<String, Integer> e : m.entrySet()) {
                if (tmp == e.getValue()) {
                    t.add(e.getKey());
                }
            }
            Collections.sort(t);
            for (int i = 0; i < t.size(); i++) {
                out.println(t.get(i));
            }
        } int n = Integer.parseInt(in.next()); n Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in String s[] = new String[n]; s new String[n] n for (int i = 0; i < n; i++) {
                s[i] = in.next();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                s[i] = in.next();
            } {
                s[i] = in.next();
            } s[i] = in.next() s[i] s i in.next() in.next in Arrays.sort(s) Arrays.sort Arrays s Map<String, Integer> m = new HashMap<>(); m new HashMap<>() int cnt = 0; cnt 0 for (int i = 0; i < n; i++) {
                if (m.get(s[i]) == null) {
                    m.put(s[i], 0);
                } else {
                    cnt = m.get(s[i]) + 1;
                    m.put(s[i], cnt);
                }
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                if (m.get(s[i]) == null) {
                    m.put(s[i], 0);
                } else {
                    cnt = m.get(s[i]) + 1;
                    m.put(s[i], cnt);
                }
            } {
                if (m.get(s[i]) == null) {
                    m.put(s[i], 0);
                } else {
                    cnt = m.get(s[i]) + 1;
                    m.put(s[i], cnt);
                }
            } if (m.get(s[i]) == null) {
                    m.put(s[i], 0);
                } else {
                    cnt = m.get(s[i]) + 1;
                    m.put(s[i], cnt);
                } m.get(s[i]) == null m.get(s[i]) m.get m s[i] s i null {
                    m.put(s[i], 0);
                } m.put(s[i], 0) m.put m s[i] s i 0 {
                    cnt = m.get(s[i]) + 1;
                    m.put(s[i], cnt);
                } cnt = m.get(s[i]) + 1 cnt m.get(s[i]) + 1 m.get(s[i]) m.get m s[i] s i 1 m.put(s[i], cnt) m.put m s[i] s i cnt List<String> t = new ArrayList<>(); t new ArrayList<>() int tmp = 0; tmp 0 for (int i = 0; i < n; i++) {
                tmp = Math.max(tmp, m.get(s[i]));
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                tmp = Math.max(tmp, m.get(s[i]));
            } {
                tmp = Math.max(tmp, m.get(s[i]));
            } tmp = Math.max(tmp, m.get(s[i])) tmp Math.max(tmp, m.get(s[i])) Math.max Math tmp m.get(s[i]) m.get m s[i] s i for (Map.Entry<String, Integer> e : m.entrySet()) {
                if (tmp == e.getValue()) {
                    t.add(e.getKey());
                }
            } Map.Entry<String, Integer> e m.entrySet() m.entrySet m {
                if (tmp == e.getValue()) {
                    t.add(e.getKey());
                }
            } {
                if (tmp == e.getValue()) {
                    t.add(e.getKey());
                }
            } if (tmp == e.getValue()) {
                    t.add(e.getKey());
                } tmp == e.getValue() tmp e.getValue() e.getValue e {
                    t.add(e.getKey());
                } t.add(e.getKey()) t.add t e.getKey() e.getKey e Collections.sort(t) Collections.sort Collections t for (int i = 0; i < t.size(); i++) {
                out.println(t.get(i));
            } int i = 0; int i = 0; i 0 i < t.size() i t.size() t.size t i++ i++ i {
                out.println(t.get(i));
            } {
                out.println(t.get(i));
            } out.println(t.get(i)) out.println out t.get(i) t.get t i int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int n = Integer.parseInt(in.next());
            String s[] = new String[n];
            for (int i = 0; i < n; i++) {
                s[i] = in.next();
            }
            Arrays.sort(s);
            Map<String, Integer> m = new HashMap<>();
            int cnt = 0;

            for (int i = 0; i < n; i++) {
                if (m.get(s[i]) == null) {
                    m.put(s[i], 0);
                } else {
                    cnt = m.get(s[i]) + 1;
                    m.put(s[i], cnt);
                }
            }

            List<String> t = new ArrayList<>();
            int tmp = 0;
            for (int i = 0; i < n; i++) {
                tmp = Math.max(tmp, m.get(s[i]));
            }

            for (Map.Entry<String, Integer> e : m.entrySet()) {
                if (tmp == e.getValue()) {
                    t.add(e.getKey());
                }
            }
            Collections.sort(t);
            for (int i = 0; i < t.size(); i++) {
                out.println(t.get(i));
            }
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int n = Integer.parseInt(in.next());
            String s[] = new String[n];
            for (int i = 0; i < n; i++) {
                s[i] = in.next();
            }
            Arrays.sort(s);
            Map<String, Integer> m = new HashMap<>();
            int cnt = 0;

            for (int i = 0; i < n; i++) {
                if (m.get(s[i]) == null) {
                    m.put(s[i], 0);
                } else {
                    cnt = m.get(s[i]) + 1;
                    m.put(s[i], cnt);
                }
            }

            List<String> t = new ArrayList<>();
            int tmp = 0;
            for (int i = 0; i < n; i++) {
                tmp = Math.max(tmp, m.get(s[i]));
            }

            for (Map.Entry<String, Integer> e : m.entrySet()) {
                if (tmp == e.getValue()) {
                    t.add(e.getKey());
                }
            }
            Collections.sort(t);
            for (int i = 0; i < t.size(); i++) {
                out.println(t.get(i));
            }
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.HashMap;
import java.util.Collections;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int n = Integer.parseInt(in.next());
            String s[] = new String[n];
            for (int i = 0; i < n; i++) {
                s[i] = in.next();
            }
            Arrays.sort(s);
            Map<String, Integer> m = new HashMap<>();
            int cnt = 0;

            for (int i = 0; i < n; i++) {
                if (m.get(s[i]) == null) {
                    m.put(s[i], 0);
                } else {
                    cnt = m.get(s[i]) + 1;
                    m.put(s[i], cnt);
                }
            }

            List<String> t = new ArrayList<>();
            int tmp = 0;
            for (int i = 0; i < n; i++) {
                tmp = Math.max(tmp, m.get(s[i]));
            }

            for (Map.Entry<String, Integer> e : m.entrySet()) {
                if (tmp == e.getValue()) {
                    t.add(e.getKey());
                }
            }
            Collections.sort(t);
            for (int i = 0; i < t.size(); i++) {
                out.println(t.get(i));
            }
        }

    }
}

