import java.util.*;
public class Main
{
    public static void main(String[] args)
    {
        int count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        //
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String,Integer> map = new HashMap<>();
        for (int i=0;i<n;++i)
        {
            String s=sc.next();
            if (map.containsKey(s))
            {
                int c = map.get(s);
                c++;
                map.put(s,c);
                if (c > max) max=c;
            }else
            {
                int c = 1;
                map.put(s,c);
                if (c > max) max=c;
            }
        }

        Set<String> set = new HashSet<>();
        for (String s:map.keySet())
        {
            int c = map.get(s);
            if (c==max) set.add(s);
        }

        List<String> list = new ArrayList<>(set);
        Collections.sort(list);
        for (String s:list) System.out.println(s);

        sc.close();
    }
} import java.util.*; util.* java public class Main
{
    public static void main(String[] args)
    {
        int count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        //
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String,Integer> map = new HashMap<>();
        for (int i=0;i<n;++i)
        {
            String s=sc.next();
            if (map.containsKey(s))
            {
                int c = map.get(s);
                c++;
                map.put(s,c);
                if (c > max) max=c;
            }else
            {
                int c = 1;
                map.put(s,c);
                if (c > max) max=c;
            }
        }

        Set<String> set = new HashSet<>();
        for (String s:map.keySet())
        {
            int c = map.get(s);
            if (c==max) set.add(s);
        }

        List<String> list = new ArrayList<>(set);
        Collections.sort(list);
        for (String s:list) System.out.println(s);

        sc.close();
    }
} Main public static void main(String[] args)
    {
        int count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        //
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String,Integer> map = new HashMap<>();
        for (int i=0;i<n;++i)
        {
            String s=sc.next();
            if (map.containsKey(s))
            {
                int c = map.get(s);
                c++;
                map.put(s,c);
                if (c > max) max=c;
            }else
            {
                int c = 1;
                map.put(s,c);
                if (c > max) max=c;
            }
        }

        Set<String> set = new HashSet<>();
        for (String s:map.keySet())
        {
            int c = map.get(s);
            if (c==max) set.add(s);
        }

        List<String> list = new ArrayList<>(set);
        Collections.sort(list);
        for (String s:list) System.out.println(s);

        sc.close();
    } main {
        int count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        //
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String,Integer> map = new HashMap<>();
        for (int i=0;i<n;++i)
        {
            String s=sc.next();
            if (map.containsKey(s))
            {
                int c = map.get(s);
                c++;
                map.put(s,c);
                if (c > max) max=c;
            }else
            {
                int c = 1;
                map.put(s,c);
                if (c > max) max=c;
            }
        }

        Set<String> set = new HashSet<>();
        for (String s:map.keySet())
        {
            int c = map.get(s);
            if (c==max) set.add(s);
        }

        List<String> list = new ArrayList<>(set);
        Collections.sort(list);
        for (String s:list) System.out.println(s);

        sc.close();
    } int count = 0; count 0 boolean sw = false; sw false int max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE double dMax = Double.MIN_VALUE; dMax Double.MIN_VALUE Double Double.MIN_VALUE double dMin = Double.MAX_VALUE; dMin Double.MAX_VALUE Double Double.MAX_VALUE Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Map<String,Integer> map = new HashMap<>(); map new HashMap<>() for (int i=0;i<n;++i)
        {
            String s=sc.next();
            if (map.containsKey(s))
            {
                int c = map.get(s);
                c++;
                map.put(s,c);
                if (c > max) max=c;
            }else
            {
                int c = 1;
                map.put(s,c);
                if (c > max) max=c;
            }
        } int i=0; int i=0; i 0 i<n i n ++i ++i i {
            String s=sc.next();
            if (map.containsKey(s))
            {
                int c = map.get(s);
                c++;
                map.put(s,c);
                if (c > max) max=c;
            }else
            {
                int c = 1;
                map.put(s,c);
                if (c > max) max=c;
            }
        } {
            String s=sc.next();
            if (map.containsKey(s))
            {
                int c = map.get(s);
                c++;
                map.put(s,c);
                if (c > max) max=c;
            }else
            {
                int c = 1;
                map.put(s,c);
                if (c > max) max=c;
            }
        } String s=sc.next(); s sc.next() sc.next sc if (map.containsKey(s))
            {
                int c = map.get(s);
                c++;
                map.put(s,c);
                if (c > max) max=c;
            }else
            {
                int c = 1;
                map.put(s,c);
                if (c > max) max=c;
            } map.containsKey(s) map.containsKey map s {
                int c = map.get(s);
                c++;
                map.put(s,c);
                if (c > max) max=c;
            } int c = map.get(s); c map.get(s) map.get map s c++ c map.put(s,c) map.put map s c if (c > max) max=c; c > max c max max=c max c {
                int c = 1;
                map.put(s,c);
                if (c > max) max=c;
            } int c = 1; c 1 map.put(s,c) map.put map s c if (c > max) max=c; c > max c max max=c max c Set<String> set = new HashSet<>(); set new HashSet<>() for (String s:map.keySet())
        {
            int c = map.get(s);
            if (c==max) set.add(s);
        } String s map.keySet() map.keySet map {
            int c = map.get(s);
            if (c==max) set.add(s);
        } {
            int c = map.get(s);
            if (c==max) set.add(s);
        } int c = map.get(s); c map.get(s) map.get map s if (c==max) set.add(s); c==max c max set.add(s) set.add set s List<String> list = new ArrayList<>(set); list new ArrayList<>(set) Collections.sort(list) Collections.sort Collections list for (String s:list) System.out.println(s); String s list System.out.println(s); System.out.println(s) System.out.println System.out System System.out s sc.close() sc.close sc String[] args args public class Main
{
    public static void main(String[] args)
    {
        int count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        //
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String,Integer> map = new HashMap<>();
        for (int i=0;i<n;++i)
        {
            String s=sc.next();
            if (map.containsKey(s))
            {
                int c = map.get(s);
                c++;
                map.put(s,c);
                if (c > max) max=c;
            }else
            {
                int c = 1;
                map.put(s,c);
                if (c > max) max=c;
            }
        }

        Set<String> set = new HashSet<>();
        for (String s:map.keySet())
        {
            int c = map.get(s);
            if (c==max) set.add(s);
        }

        List<String> list = new ArrayList<>(set);
        Collections.sort(list);
        for (String s:list) System.out.println(s);

        sc.close();
    }
} public class Main
{
    public static void main(String[] args)
    {
        int count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        //
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String,Integer> map = new HashMap<>();
        for (int i=0;i<n;++i)
        {
            String s=sc.next();
            if (map.containsKey(s))
            {
                int c = map.get(s);
                c++;
                map.put(s,c);
                if (c > max) max=c;
            }else
            {
                int c = 1;
                map.put(s,c);
                if (c > max) max=c;
            }
        }

        Set<String> set = new HashSet<>();
        for (String s:map.keySet())
        {
            int c = map.get(s);
            if (c==max) set.add(s);
        }

        List<String> list = new ArrayList<>(set);
        Collections.sort(list);
        for (String s:list) System.out.println(s);

        sc.close();
    }
} Main
import java.util.*;
public class Main
{
    public static void main(String[] args)
    {
        int count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        //
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String,Integer> map = new HashMap<>();
        for (int i=0;i<n;++i)
        {
            String s=sc.next();
            if (map.containsKey(s))
            {
                int c = map.get(s);
                c++;
                map.put(s,c);
                if (c > max) max=c;
            }else
            {
                int c = 1;
                map.put(s,c);
                if (c > max) max=c;
            }
        }

        Set<String> set = new HashSet<>();
        for (String s:map.keySet())
        {
            int c = map.get(s);
            if (c==max) set.add(s);
        }

        List<String> list = new ArrayList<>(set);
        Collections.sort(list);
        for (String s:list) System.out.println(s);

        sc.close();
    }
}