import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.Map;
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
 *
 * @author varunvats32
 */
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);
        CPoll solver = new CPoll();
        solver.solve(1, in, out);
        out.close();
    }

    static class CPoll {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            List<String> list = new ArrayList<>();
            Map<String, Integer> map = new HashMap<>();

            in.nextLine();
            int max = 0;
            for (int i = 1; i <= n; i++) {
                String s = in.nextLine();
                if (!map.containsKey(s)) {
                    map.put(s, 0);
                }
                int count = map.get(s) + 1;
                max = Math.max(count, max);
                map.put(s, map.get(s) + 1);
            }

            for (String s : map.keySet()) {
                if (map.get(s) == max) {
                    list.add(s);
                }
            }

            Collections.sort(list);

            for (int i = 0; i < list.size(); i++) {
                out.println(list.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.List; List java.util import java.util.Map; Map java.util 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);
        CPoll solver = new CPoll();
        solver.solve(1, in, out);
        out.close();
    }

    static class CPoll {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            List<String> list = new ArrayList<>();
            Map<String, Integer> map = new HashMap<>();

            in.nextLine();
            int max = 0;
            for (int i = 1; i <= n; i++) {
                String s = in.nextLine();
                if (!map.containsKey(s)) {
                    map.put(s, 0);
                }
                int count = map.get(s) + 1;
                max = Math.max(count, max);
                map.put(s, map.get(s) + 1);
            }

            for (String s : map.keySet()) {
                if (map.get(s) == max) {
                    list.add(s);
                }
            }

            Collections.sort(list);

            for (int i = 0; i < list.size(); i++) {
                out.println(list.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);
        CPoll solver = new CPoll();
        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);
        CPoll solver = new CPoll();
        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) CPoll solver = new CPoll(); solver new CPoll() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class CPoll {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            List<String> list = new ArrayList<>();
            Map<String, Integer> map = new HashMap<>();

            in.nextLine();
            int max = 0;
            for (int i = 1; i <= n; i++) {
                String s = in.nextLine();
                if (!map.containsKey(s)) {
                    map.put(s, 0);
                }
                int count = map.get(s) + 1;
                max = Math.max(count, max);
                map.put(s, map.get(s) + 1);
            }

            for (String s : map.keySet()) {
                if (map.get(s) == max) {
                    list.add(s);
                }
            }

            Collections.sort(list);

            for (int i = 0; i < list.size(); i++) {
                out.println(list.get(i));
            }
        }

    } CPoll public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            List<String> list = new ArrayList<>();
            Map<String, Integer> map = new HashMap<>();

            in.nextLine();
            int max = 0;
            for (int i = 1; i <= n; i++) {
                String s = in.nextLine();
                if (!map.containsKey(s)) {
                    map.put(s, 0);
                }
                int count = map.get(s) + 1;
                max = Math.max(count, max);
                map.put(s, map.get(s) + 1);
            }

            for (String s : map.keySet()) {
                if (map.get(s) == max) {
                    list.add(s);
                }
            }

            Collections.sort(list);

            for (int i = 0; i < list.size(); i++) {
                out.println(list.get(i));
            }
        } solve {
            int n = in.nextInt();
            List<String> list = new ArrayList<>();
            Map<String, Integer> map = new HashMap<>();

            in.nextLine();
            int max = 0;
            for (int i = 1; i <= n; i++) {
                String s = in.nextLine();
                if (!map.containsKey(s)) {
                    map.put(s, 0);
                }
                int count = map.get(s) + 1;
                max = Math.max(count, max);
                map.put(s, map.get(s) + 1);
            }

            for (String s : map.keySet()) {
                if (map.get(s) == max) {
                    list.add(s);
                }
            }

            Collections.sort(list);

            for (int i = 0; i < list.size(); i++) {
                out.println(list.get(i));
            }
        } int n = in.nextInt(); n in.nextInt() in.nextInt in List<String> list = new ArrayList<>(); list new ArrayList<>() Map<String, Integer> map = new HashMap<>(); map new HashMap<>() in.nextLine() in.nextLine in int max = 0; max 0 for (int i = 1; i <= n; i++) {
                String s = in.nextLine();
                if (!map.containsKey(s)) {
                    map.put(s, 0);
                }
                int count = map.get(s) + 1;
                max = Math.max(count, max);
                map.put(s, map.get(s) + 1);
            } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
                String s = in.nextLine();
                if (!map.containsKey(s)) {
                    map.put(s, 0);
                }
                int count = map.get(s) + 1;
                max = Math.max(count, max);
                map.put(s, map.get(s) + 1);
            } {
                String s = in.nextLine();
                if (!map.containsKey(s)) {
                    map.put(s, 0);
                }
                int count = map.get(s) + 1;
                max = Math.max(count, max);
                map.put(s, map.get(s) + 1);
            } String s = in.nextLine(); s in.nextLine() in.nextLine in if (!map.containsKey(s)) {
                    map.put(s, 0);
                } !map.containsKey(s) map.containsKey(s) map.containsKey map s {
                    map.put(s, 0);
                } map.put(s, 0) map.put map s 0 int count = map.get(s) + 1; count map.get(s) + 1 map.get(s) map.get map s 1 max = Math.max(count, max) max Math.max(count, max) Math.max Math count max map.put(s, map.get(s) + 1) map.put map s map.get(s) + 1 map.get(s) map.get map s 1 for (String s : map.keySet()) {
                if (map.get(s) == max) {
                    list.add(s);
                }
            } String s map.keySet() map.keySet map {
                if (map.get(s) == max) {
                    list.add(s);
                }
            } {
                if (map.get(s) == max) {
                    list.add(s);
                }
            } if (map.get(s) == max) {
                    list.add(s);
                } map.get(s) == max map.get(s) map.get map s max {
                    list.add(s);
                } list.add(s) list.add list s Collections.sort(list) Collections.sort Collections list for (int i = 0; i < list.size(); i++) {
                out.println(list.get(i));
            } int i = 0; int i = 0; i 0 i < list.size() i list.size() list.size list i++ i++ i {
                out.println(list.get(i));
            } {
                out.println(list.get(i));
            } out.println(list.get(i)) out.println out list.get(i) list.get list 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);
        CPoll solver = new CPoll();
        solver.solve(1, in, out);
        out.close();
    }

    static class CPoll {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            List<String> list = new ArrayList<>();
            Map<String, Integer> map = new HashMap<>();

            in.nextLine();
            int max = 0;
            for (int i = 1; i <= n; i++) {
                String s = in.nextLine();
                if (!map.containsKey(s)) {
                    map.put(s, 0);
                }
                int count = map.get(s) + 1;
                max = Math.max(count, max);
                map.put(s, map.get(s) + 1);
            }

            for (String s : map.keySet()) {
                if (map.get(s) == max) {
                    list.add(s);
                }
            }

            Collections.sort(list);

            for (int i = 0; i < list.size(); i++) {
                out.println(list.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);
        CPoll solver = new CPoll();
        solver.solve(1, in, out);
        out.close();
    }

    static class CPoll {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            List<String> list = new ArrayList<>();
            Map<String, Integer> map = new HashMap<>();

            in.nextLine();
            int max = 0;
            for (int i = 1; i <= n; i++) {
                String s = in.nextLine();
                if (!map.containsKey(s)) {
                    map.put(s, 0);
                }
                int count = map.get(s) + 1;
                max = Math.max(count, max);
                map.put(s, map.get(s) + 1);
            }

            for (String s : map.keySet()) {
                if (map.get(s) == max) {
                    list.add(s);
                }
            }

            Collections.sort(list);

            for (int i = 0; i < list.size(); i++) {
                out.println(list.get(i));
            }
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.Map;
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
 *
 * @author varunvats32
 */
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);
        CPoll solver = new CPoll();
        solver.solve(1, in, out);
        out.close();
    }

    static class CPoll {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            List<String> list = new ArrayList<>();
            Map<String, Integer> map = new HashMap<>();

            in.nextLine();
            int max = 0;
            for (int i = 1; i <= n; i++) {
                String s = in.nextLine();
                if (!map.containsKey(s)) {
                    map.put(s, 0);
                }
                int count = map.get(s) + 1;
                max = Math.max(count, max);
                map.put(s, map.get(s) + 1);
            }

            for (String s : map.keySet()) {
                if (map.get(s) == max) {
                    list.add(s);
                }
            }

            Collections.sort(list);

            for (int i = 0; i < list.size(); i++) {
                out.println(list.get(i));
            }
        }

    }
}

