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
 */
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);
        TaskAtCoder solver = new TaskAtCoder();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskAtCoder
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int N = in.nextInt();
            Map<String, Integer> map = new HashMap<>(N);
            for (int i = 0; i < N; i++)
            {
                String s = in.next();
                int occ = map.getOrDefault(s, 0);
                map.put(s, ++occ);
            }

            int max = Integer.MIN_VALUE;
            for (String s : map.keySet())
            {
                max = Math.max(max, map.get(s));
            }
            List<String> list = new ArrayList<>();
            for (String s : map.keySet())
            {
                if (map.get(s) == max) list.add(s);
            }
            Collections.sort(list);
            for (int i = 0; i < list.size(); i++)
            {
                if (i == list.size() - 1)
                    out.print(list.get(i));
                else
                    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);
        TaskAtCoder solver = new TaskAtCoder();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskAtCoder
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int N = in.nextInt();
            Map<String, Integer> map = new HashMap<>(N);
            for (int i = 0; i < N; i++)
            {
                String s = in.next();
                int occ = map.getOrDefault(s, 0);
                map.put(s, ++occ);
            }

            int max = Integer.MIN_VALUE;
            for (String s : map.keySet())
            {
                max = Math.max(max, map.get(s));
            }
            List<String> list = new ArrayList<>();
            for (String s : map.keySet())
            {
                if (map.get(s) == max) list.add(s);
            }
            Collections.sort(list);
            for (int i = 0; i < list.size(); i++)
            {
                if (i == list.size() - 1)
                    out.print(list.get(i));
                else
                    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);
        TaskAtCoder solver = new TaskAtCoder();
        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);
        TaskAtCoder solver = new TaskAtCoder();
        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) TaskAtCoder solver = new TaskAtCoder(); solver new TaskAtCoder() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class TaskAtCoder
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int N = in.nextInt();
            Map<String, Integer> map = new HashMap<>(N);
            for (int i = 0; i < N; i++)
            {
                String s = in.next();
                int occ = map.getOrDefault(s, 0);
                map.put(s, ++occ);
            }

            int max = Integer.MIN_VALUE;
            for (String s : map.keySet())
            {
                max = Math.max(max, map.get(s));
            }
            List<String> list = new ArrayList<>();
            for (String s : map.keySet())
            {
                if (map.get(s) == max) list.add(s);
            }
            Collections.sort(list);
            for (int i = 0; i < list.size(); i++)
            {
                if (i == list.size() - 1)
                    out.print(list.get(i));
                else
                    out.println(list.get(i));
            }
        }

    } TaskAtCoder public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int N = in.nextInt();
            Map<String, Integer> map = new HashMap<>(N);
            for (int i = 0; i < N; i++)
            {
                String s = in.next();
                int occ = map.getOrDefault(s, 0);
                map.put(s, ++occ);
            }

            int max = Integer.MIN_VALUE;
            for (String s : map.keySet())
            {
                max = Math.max(max, map.get(s));
            }
            List<String> list = new ArrayList<>();
            for (String s : map.keySet())
            {
                if (map.get(s) == max) list.add(s);
            }
            Collections.sort(list);
            for (int i = 0; i < list.size(); i++)
            {
                if (i == list.size() - 1)
                    out.print(list.get(i));
                else
                    out.println(list.get(i));
            }
        } solve {
            int N = in.nextInt();
            Map<String, Integer> map = new HashMap<>(N);
            for (int i = 0; i < N; i++)
            {
                String s = in.next();
                int occ = map.getOrDefault(s, 0);
                map.put(s, ++occ);
            }

            int max = Integer.MIN_VALUE;
            for (String s : map.keySet())
            {
                max = Math.max(max, map.get(s));
            }
            List<String> list = new ArrayList<>();
            for (String s : map.keySet())
            {
                if (map.get(s) == max) list.add(s);
            }
            Collections.sort(list);
            for (int i = 0; i < list.size(); i++)
            {
                if (i == list.size() - 1)
                    out.print(list.get(i));
                else
                    out.println(list.get(i));
            }
        } int N = in.nextInt(); N in.nextInt() in.nextInt in Map<String, Integer> map = new HashMap<>(N); map new HashMap<>(N) for (int i = 0; i < N; i++)
            {
                String s = in.next();
                int occ = map.getOrDefault(s, 0);
                map.put(s, ++occ);
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                String s = in.next();
                int occ = map.getOrDefault(s, 0);
                map.put(s, ++occ);
            } {
                String s = in.next();
                int occ = map.getOrDefault(s, 0);
                map.put(s, ++occ);
            } String s = in.next(); s in.next() in.next in int occ = map.getOrDefault(s, 0); occ map.getOrDefault(s, 0) map.getOrDefault map s 0 map.put(s, ++occ) map.put map s ++occ occ int max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE for (String s : map.keySet())
            {
                max = Math.max(max, map.get(s));
            } String s map.keySet() map.keySet map {
                max = Math.max(max, map.get(s));
            } {
                max = Math.max(max, map.get(s));
            } max = Math.max(max, map.get(s)) max Math.max(max, map.get(s)) Math.max Math max map.get(s) map.get map s List<String> list = new ArrayList<>(); list new ArrayList<>() 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 list s Collections.sort(list) Collections.sort Collections list for (int i = 0; i < list.size(); i++)
            {
                if (i == list.size() - 1)
                    out.print(list.get(i));
                else
                    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 {
                if (i == list.size() - 1)
                    out.print(list.get(i));
                else
                    out.println(list.get(i));
            } {
                if (i == list.size() - 1)
                    out.print(list.get(i));
                else
                    out.println(list.get(i));
            } if (i == list.size() - 1)
                    out.print(list.get(i));
                else
                    out.println(list.get(i)); i == list.size() - 1 i list.size() - 1 list.size() list.size list 1 out.print(list.get(i)) out.print out list.get(i) list.get list 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);
        TaskAtCoder solver = new TaskAtCoder();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskAtCoder
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int N = in.nextInt();
            Map<String, Integer> map = new HashMap<>(N);
            for (int i = 0; i < N; i++)
            {
                String s = in.next();
                int occ = map.getOrDefault(s, 0);
                map.put(s, ++occ);
            }

            int max = Integer.MIN_VALUE;
            for (String s : map.keySet())
            {
                max = Math.max(max, map.get(s));
            }
            List<String> list = new ArrayList<>();
            for (String s : map.keySet())
            {
                if (map.get(s) == max) list.add(s);
            }
            Collections.sort(list);
            for (int i = 0; i < list.size(); i++)
            {
                if (i == list.size() - 1)
                    out.print(list.get(i));
                else
                    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);
        TaskAtCoder solver = new TaskAtCoder();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskAtCoder
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int N = in.nextInt();
            Map<String, Integer> map = new HashMap<>(N);
            for (int i = 0; i < N; i++)
            {
                String s = in.next();
                int occ = map.getOrDefault(s, 0);
                map.put(s, ++occ);
            }

            int max = Integer.MIN_VALUE;
            for (String s : map.keySet())
            {
                max = Math.max(max, map.get(s));
            }
            List<String> list = new ArrayList<>();
            for (String s : map.keySet())
            {
                if (map.get(s) == max) list.add(s);
            }
            Collections.sort(list);
            for (int i = 0; i < list.size(); i++)
            {
                if (i == list.size() - 1)
                    out.print(list.get(i));
                else
                    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
 */
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);
        TaskAtCoder solver = new TaskAtCoder();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskAtCoder
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int N = in.nextInt();
            Map<String, Integer> map = new HashMap<>(N);
            for (int i = 0; i < N; i++)
            {
                String s = in.next();
                int occ = map.getOrDefault(s, 0);
                map.put(s, ++occ);
            }

            int max = Integer.MIN_VALUE;
            for (String s : map.keySet())
            {
                max = Math.max(max, map.get(s));
            }
            List<String> list = new ArrayList<>();
            for (String s : map.keySet())
            {
                if (map.get(s) == max) list.add(s);
            }
            Collections.sort(list);
            for (int i = 0; i < list.size(); i++)
            {
                if (i == list.size() - 1)
                    out.print(list.get(i));
                else
                    out.println(list.get(i));
            }
        }

    }
}

