import java.util.Scanner;
import java.util.Map;
import java.util.TreeMap;
import java.util.Iterator;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        TreeMap<String, Integer> S = new TreeMap<String, Integer>();               
        String tmp;
        int max = 1;
        int count;

        for(int i=0; i<N; i++){
            tmp = sc.next();
            
            if(S.containsKey(tmp)){
                count = S.get(tmp)+1;
                if(max < count){
                    max = count;
                }
                S.put(tmp,count);
            } else {
                S.put(tmp,1);
            }
            
            
        }
        for(Iterator<String> it = S.keySet().iterator();it.hasNext();){
            String result = it.next();

            if(S.get(result) == max){
                System.out.println(result);
            }
        }
        
    }
} import java.util.Scanner; Scanner java.util import java.util.Map; Map java.util import java.util.TreeMap; TreeMap java.util import java.util.Iterator; Iterator java.util public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        TreeMap<String, Integer> S = new TreeMap<String, Integer>();               
        String tmp;
        int max = 1;
        int count;

        for(int i=0; i<N; i++){
            tmp = sc.next();
            
            if(S.containsKey(tmp)){
                count = S.get(tmp)+1;
                if(max < count){
                    max = count;
                }
                S.put(tmp,count);
            } else {
                S.put(tmp,1);
            }
            
            
        }
        for(Iterator<String> it = S.keySet().iterator();it.hasNext();){
            String result = it.next();

            if(S.get(result) == max){
                System.out.println(result);
            }
        }
        
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        TreeMap<String, Integer> S = new TreeMap<String, Integer>();               
        String tmp;
        int max = 1;
        int count;

        for(int i=0; i<N; i++){
            tmp = sc.next();
            
            if(S.containsKey(tmp)){
                count = S.get(tmp)+1;
                if(max < count){
                    max = count;
                }
                S.put(tmp,count);
            } else {
                S.put(tmp,1);
            }
            
            
        }
        for(Iterator<String> it = S.keySet().iterator();it.hasNext();){
            String result = it.next();

            if(S.get(result) == max){
                System.out.println(result);
            }
        }
        
    } main {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        TreeMap<String, Integer> S = new TreeMap<String, Integer>();               
        String tmp;
        int max = 1;
        int count;

        for(int i=0; i<N; i++){
            tmp = sc.next();
            
            if(S.containsKey(tmp)){
                count = S.get(tmp)+1;
                if(max < count){
                    max = count;
                }
                S.put(tmp,count);
            } else {
                S.put(tmp,1);
            }
            
            
        }
        for(Iterator<String> it = S.keySet().iterator();it.hasNext();){
            String result = it.next();

            if(S.get(result) == max){
                System.out.println(result);
            }
        }
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc TreeMap<String, Integer> S = new TreeMap<String, Integer>(); S new TreeMap<String, Integer>() String tmp; tmp int max = 1; max 1 int count; count for(int i=0; i<N; i++){
            tmp = sc.next();
            
            if(S.containsKey(tmp)){
                count = S.get(tmp)+1;
                if(max < count){
                    max = count;
                }
                S.put(tmp,count);
            } else {
                S.put(tmp,1);
            }
            
            
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            tmp = sc.next();
            
            if(S.containsKey(tmp)){
                count = S.get(tmp)+1;
                if(max < count){
                    max = count;
                }
                S.put(tmp,count);
            } else {
                S.put(tmp,1);
            }
            
            
        } {
            tmp = sc.next();
            
            if(S.containsKey(tmp)){
                count = S.get(tmp)+1;
                if(max < count){
                    max = count;
                }
                S.put(tmp,count);
            } else {
                S.put(tmp,1);
            }
            
            
        } tmp = sc.next() tmp sc.next() sc.next sc if(S.containsKey(tmp)){
                count = S.get(tmp)+1;
                if(max < count){
                    max = count;
                }
                S.put(tmp,count);
            } else {
                S.put(tmp,1);
            } S.containsKey(tmp) S.containsKey S tmp {
                count = S.get(tmp)+1;
                if(max < count){
                    max = count;
                }
                S.put(tmp,count);
            } count = S.get(tmp)+1 count S.get(tmp)+1 S.get(tmp) S.get S tmp 1 if(max < count){
                    max = count;
                } max < count max count {
                    max = count;
                } max = count max count S.put(tmp,count) S.put S tmp count {
                S.put(tmp,1);
            } S.put(tmp,1) S.put S tmp 1 for(Iterator<String> it = S.keySet().iterator();it.hasNext();){
            String result = it.next();

            if(S.get(result) == max){
                System.out.println(result);
            }
        } Iterator<String> it = S.keySet().iterator(); Iterator<String> it = S.keySet().iterator(); it S.keySet().iterator() S.keySet().iterator S.keySet() S.keySet S it.hasNext() it.hasNext it {
            String result = it.next();

            if(S.get(result) == max){
                System.out.println(result);
            }
        } {
            String result = it.next();

            if(S.get(result) == max){
                System.out.println(result);
            }
        } String result = it.next(); result it.next() it.next it if(S.get(result) == max){
                System.out.println(result);
            } S.get(result) == max S.get(result) S.get S result max {
                System.out.println(result);
            } System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        TreeMap<String, Integer> S = new TreeMap<String, Integer>();               
        String tmp;
        int max = 1;
        int count;

        for(int i=0; i<N; i++){
            tmp = sc.next();
            
            if(S.containsKey(tmp)){
                count = S.get(tmp)+1;
                if(max < count){
                    max = count;
                }
                S.put(tmp,count);
            } else {
                S.put(tmp,1);
            }
            
            
        }
        for(Iterator<String> it = S.keySet().iterator();it.hasNext();){
            String result = it.next();

            if(S.get(result) == max){
                System.out.println(result);
            }
        }
        
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        TreeMap<String, Integer> S = new TreeMap<String, Integer>();               
        String tmp;
        int max = 1;
        int count;

        for(int i=0; i<N; i++){
            tmp = sc.next();
            
            if(S.containsKey(tmp)){
                count = S.get(tmp)+1;
                if(max < count){
                    max = count;
                }
                S.put(tmp,count);
            } else {
                S.put(tmp,1);
            }
            
            
        }
        for(Iterator<String> it = S.keySet().iterator();it.hasNext();){
            String result = it.next();

            if(S.get(result) == max){
                System.out.println(result);
            }
        }
        
    }
} Main
import java.util.Scanner;
import java.util.Map;
import java.util.TreeMap;
import java.util.Iterator;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        TreeMap<String, Integer> S = new TreeMap<String, Integer>();               
        String tmp;
        int max = 1;
        int count;

        for(int i=0; i<N; i++){
            tmp = sc.next();
            
            if(S.containsKey(tmp)){
                count = S.get(tmp)+1;
                if(max < count){
                    max = count;
                }
                S.put(tmp,count);
            } else {
                S.put(tmp,1);
            }
            
            
        }
        for(Iterator<String> it = S.keySet().iterator();it.hasNext();){
            String result = it.next();

            if(S.get(result) == max){
                System.out.println(result);
            }
        }
        
    }
}
