import java.util.*;

public class Main {

    public static void main(String []args){
        Scanner in = new Scanner(System.in);

        int n;
        n = in.nextInt();

        SortedMap<String,Integer> poll = new TreeMap<String, Integer>();

        int maxvote = 0;
        for(long i=0;i<n;i++)
        {
            String candidate = in.next();
            if(poll.containsKey(candidate))
            {
                poll.put(candidate,poll.get(candidate)+1);
            }
            else{
                poll.put(candidate,1);
            }
            maxvote = Math.max(maxvote,poll.get(candidate));
        }

        for(String candidate:poll.keySet())
        {
            if(poll.get(candidate)==maxvote)
                System.out.println(candidate);
        }

    }

} import java.util.*; util.* java public class Main {

    public static void main(String []args){
        Scanner in = new Scanner(System.in);

        int n;
        n = in.nextInt();

        SortedMap<String,Integer> poll = new TreeMap<String, Integer>();

        int maxvote = 0;
        for(long i=0;i<n;i++)
        {
            String candidate = in.next();
            if(poll.containsKey(candidate))
            {
                poll.put(candidate,poll.get(candidate)+1);
            }
            else{
                poll.put(candidate,1);
            }
            maxvote = Math.max(maxvote,poll.get(candidate));
        }

        for(String candidate:poll.keySet())
        {
            if(poll.get(candidate)==maxvote)
                System.out.println(candidate);
        }

    }

} Main public static void main(String []args){
        Scanner in = new Scanner(System.in);

        int n;
        n = in.nextInt();

        SortedMap<String,Integer> poll = new TreeMap<String, Integer>();

        int maxvote = 0;
        for(long i=0;i<n;i++)
        {
            String candidate = in.next();
            if(poll.containsKey(candidate))
            {
                poll.put(candidate,poll.get(candidate)+1);
            }
            else{
                poll.put(candidate,1);
            }
            maxvote = Math.max(maxvote,poll.get(candidate));
        }

        for(String candidate:poll.keySet())
        {
            if(poll.get(candidate)==maxvote)
                System.out.println(candidate);
        }

    } main {
        Scanner in = new Scanner(System.in);

        int n;
        n = in.nextInt();

        SortedMap<String,Integer> poll = new TreeMap<String, Integer>();

        int maxvote = 0;
        for(long i=0;i<n;i++)
        {
            String candidate = in.next();
            if(poll.containsKey(candidate))
            {
                poll.put(candidate,poll.get(candidate)+1);
            }
            else{
                poll.put(candidate,1);
            }
            maxvote = Math.max(maxvote,poll.get(candidate));
        }

        for(String candidate:poll.keySet())
        {
            if(poll.get(candidate)==maxvote)
                System.out.println(candidate);
        }

    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n; n n = in.nextInt() n in.nextInt() in.nextInt in SortedMap<String,Integer> poll = new TreeMap<String, Integer>(); poll new TreeMap<String, Integer>() int maxvote = 0; maxvote 0 for(long i=0;i<n;i++)
        {
            String candidate = in.next();
            if(poll.containsKey(candidate))
            {
                poll.put(candidate,poll.get(candidate)+1);
            }
            else{
                poll.put(candidate,1);
            }
            maxvote = Math.max(maxvote,poll.get(candidate));
        } long i=0; long i=0; i 0 i<n i n i++ i++ i {
            String candidate = in.next();
            if(poll.containsKey(candidate))
            {
                poll.put(candidate,poll.get(candidate)+1);
            }
            else{
                poll.put(candidate,1);
            }
            maxvote = Math.max(maxvote,poll.get(candidate));
        } {
            String candidate = in.next();
            if(poll.containsKey(candidate))
            {
                poll.put(candidate,poll.get(candidate)+1);
            }
            else{
                poll.put(candidate,1);
            }
            maxvote = Math.max(maxvote,poll.get(candidate));
        } String candidate = in.next(); candidate in.next() in.next in if(poll.containsKey(candidate))
            {
                poll.put(candidate,poll.get(candidate)+1);
            }
            else{
                poll.put(candidate,1);
            } poll.containsKey(candidate) poll.containsKey poll candidate {
                poll.put(candidate,poll.get(candidate)+1);
            } poll.put(candidate,poll.get(candidate)+1) poll.put poll candidate poll.get(candidate)+1 poll.get(candidate) poll.get poll candidate 1 {
                poll.put(candidate,1);
            } poll.put(candidate,1) poll.put poll candidate 1 maxvote = Math.max(maxvote,poll.get(candidate)) maxvote Math.max(maxvote,poll.get(candidate)) Math.max Math maxvote poll.get(candidate) poll.get poll candidate for(String candidate:poll.keySet())
        {
            if(poll.get(candidate)==maxvote)
                System.out.println(candidate);
        } String candidate poll.keySet() poll.keySet poll {
            if(poll.get(candidate)==maxvote)
                System.out.println(candidate);
        } {
            if(poll.get(candidate)==maxvote)
                System.out.println(candidate);
        } if(poll.get(candidate)==maxvote)
                System.out.println(candidate); poll.get(candidate)==maxvote poll.get(candidate) poll.get poll candidate maxvote System.out.println(candidate) System.out.println System.out System System.out candidate String []args args public class Main {

    public static void main(String []args){
        Scanner in = new Scanner(System.in);

        int n;
        n = in.nextInt();

        SortedMap<String,Integer> poll = new TreeMap<String, Integer>();

        int maxvote = 0;
        for(long i=0;i<n;i++)
        {
            String candidate = in.next();
            if(poll.containsKey(candidate))
            {
                poll.put(candidate,poll.get(candidate)+1);
            }
            else{
                poll.put(candidate,1);
            }
            maxvote = Math.max(maxvote,poll.get(candidate));
        }

        for(String candidate:poll.keySet())
        {
            if(poll.get(candidate)==maxvote)
                System.out.println(candidate);
        }

    }

} public class Main {

    public static void main(String []args){
        Scanner in = new Scanner(System.in);

        int n;
        n = in.nextInt();

        SortedMap<String,Integer> poll = new TreeMap<String, Integer>();

        int maxvote = 0;
        for(long i=0;i<n;i++)
        {
            String candidate = in.next();
            if(poll.containsKey(candidate))
            {
                poll.put(candidate,poll.get(candidate)+1);
            }
            else{
                poll.put(candidate,1);
            }
            maxvote = Math.max(maxvote,poll.get(candidate));
        }

        for(String candidate:poll.keySet())
        {
            if(poll.get(candidate)==maxvote)
                System.out.println(candidate);
        }

    }

} Main
import java.util.*;

public class Main {

    public static void main(String []args){
        Scanner in = new Scanner(System.in);

        int n;
        n = in.nextInt();

        SortedMap<String,Integer> poll = new TreeMap<String, Integer>();

        int maxvote = 0;
        for(long i=0;i<n;i++)
        {
            String candidate = in.next();
            if(poll.containsKey(candidate))
            {
                poll.put(candidate,poll.get(candidate)+1);
            }
            else{
                poll.put(candidate,1);
            }
            maxvote = Math.max(maxvote,poll.get(candidate));
        }

        for(String candidate:poll.keySet())
        {
            if(poll.get(candidate)==maxvote)
                System.out.println(candidate);
        }

    }

}
