import java.util.*;

class Main {
    // 
    static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intの最大値 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<String,Integer> str = new HashMap<String,Integer>();
        for(int i = 0;i < n;i++){
            String s = sc.next();
            if(str.containsKey(s)){
                int tmp = str.get(s);
                tmp++;
                str.put(s, tmp);
            }else{
                str.put(s, 1);
            }
        }
        int high = 0;
        int count = 0;
        for(int i:str.values()){
            if(high < i)high = i;
        }
        for(int i:str.values()){
            if(high == i)count++;
        }
        
        List moji = new ArrayList<String>();
        for(Map.Entry<String,Integer> entry:str.entrySet()){
            if(entry.getValue()==high){
                //System.out.println(entry.getKey());
                moji.add(entry.getKey());
            }
        }
        Collections.sort(moji);
        for(int i=0;i<moji.size();i++){
			System.out.println(moji.get(i));
		}
    }

} import java.util.*; util.* java class Main {
    // 
    static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intの最大値 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<String,Integer> str = new HashMap<String,Integer>();
        for(int i = 0;i < n;i++){
            String s = sc.next();
            if(str.containsKey(s)){
                int tmp = str.get(s);
                tmp++;
                str.put(s, tmp);
            }else{
                str.put(s, 1);
            }
        }
        int high = 0;
        int count = 0;
        for(int i:str.values()){
            if(high < i)high = i;
        }
        for(int i:str.values()){
            if(high == i)count++;
        }
        
        List moji = new ArrayList<String>();
        for(Map.Entry<String,Integer> entry:str.entrySet()){
            if(entry.getValue()==high){
                //System.out.println(entry.getKey());
                moji.add(entry.getKey());
            }
        }
        Collections.sort(moji);
        for(int i=0;i<moji.size();i++){
			System.out.println(moji.get(i));
		}
    }

} Main // 
    static final long MOD = 1_000_000_007; // 10^9+7 MOD 1_000_000_007 static final int MAX = 2_147_483_646; // intの最大値  MAX 2_147_483_646 static final int INF = 1_000_000_000; // 10^9   INF 1_000_000_000 public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<String,Integer> str = new HashMap<String,Integer>();
        for(int i = 0;i < n;i++){
            String s = sc.next();
            if(str.containsKey(s)){
                int tmp = str.get(s);
                tmp++;
                str.put(s, tmp);
            }else{
                str.put(s, 1);
            }
        }
        int high = 0;
        int count = 0;
        for(int i:str.values()){
            if(high < i)high = i;
        }
        for(int i:str.values()){
            if(high == i)count++;
        }
        
        List moji = new ArrayList<String>();
        for(Map.Entry<String,Integer> entry:str.entrySet()){
            if(entry.getValue()==high){
                //System.out.println(entry.getKey());
                moji.add(entry.getKey());
            }
        }
        Collections.sort(moji);
        for(int i=0;i<moji.size();i++){
			System.out.println(moji.get(i));
		}
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<String,Integer> str = new HashMap<String,Integer>();
        for(int i = 0;i < n;i++){
            String s = sc.next();
            if(str.containsKey(s)){
                int tmp = str.get(s);
                tmp++;
                str.put(s, tmp);
            }else{
                str.put(s, 1);
            }
        }
        int high = 0;
        int count = 0;
        for(int i:str.values()){
            if(high < i)high = i;
        }
        for(int i:str.values()){
            if(high == i)count++;
        }
        
        List moji = new ArrayList<String>();
        for(Map.Entry<String,Integer> entry:str.entrySet()){
            if(entry.getValue()==high){
                //System.out.println(entry.getKey());
                moji.add(entry.getKey());
            }
        }
        Collections.sort(moji);
        for(int i=0;i<moji.size();i++){
			System.out.println(moji.get(i));
		}
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc HashMap<String,Integer> str = new HashMap<String,Integer>(); str new HashMap<String,Integer>() for(int i = 0;i < n;i++){
            String s = sc.next();
            if(str.containsKey(s)){
                int tmp = str.get(s);
                tmp++;
                str.put(s, tmp);
            }else{
                str.put(s, 1);
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String s = sc.next();
            if(str.containsKey(s)){
                int tmp = str.get(s);
                tmp++;
                str.put(s, tmp);
            }else{
                str.put(s, 1);
            }
        } {
            String s = sc.next();
            if(str.containsKey(s)){
                int tmp = str.get(s);
                tmp++;
                str.put(s, tmp);
            }else{
                str.put(s, 1);
            }
        } String s = sc.next(); s sc.next() sc.next sc if(str.containsKey(s)){
                int tmp = str.get(s);
                tmp++;
                str.put(s, tmp);
            }else{
                str.put(s, 1);
            } str.containsKey(s) str.containsKey str s {
                int tmp = str.get(s);
                tmp++;
                str.put(s, tmp);
            } int tmp = str.get(s); tmp str.get(s) str.get str s tmp++ tmp str.put(s, tmp) str.put str s tmp {
                str.put(s, 1);
            } str.put(s, 1) str.put str s 1 int high = 0; high 0 int count = 0; count 0 for(int i:str.values()){
            if(high < i)high = i;
        } int i str.values() str.values str {
            if(high < i)high = i;
        } {
            if(high < i)high = i;
        } if(high < i)high = i; high < i high i high = i high i for(int i:str.values()){
            if(high == i)count++;
        } int i str.values() str.values str {
            if(high == i)count++;
        } {
            if(high == i)count++;
        } if(high == i)count++; high == i high i count++ count List moji = new ArrayList<String>(); moji new ArrayList<String>() for(Map.Entry<String,Integer> entry:str.entrySet()){
            if(entry.getValue()==high){
                //System.out.println(entry.getKey());
                moji.add(entry.getKey());
            }
        } Map.Entry<String,Integer> entry str.entrySet() str.entrySet str {
            if(entry.getValue()==high){
                //System.out.println(entry.getKey());
                moji.add(entry.getKey());
            }
        } {
            if(entry.getValue()==high){
                //System.out.println(entry.getKey());
                moji.add(entry.getKey());
            }
        } if(entry.getValue()==high){
                //System.out.println(entry.getKey());
                moji.add(entry.getKey());
            } entry.getValue()==high entry.getValue() entry.getValue entry high {
                //System.out.println(entry.getKey());
                moji.add(entry.getKey());
            } moji.add(entry.getKey()) moji.add moji entry.getKey() entry.getKey entry Collections.sort(moji) Collections.sort Collections moji for(int i=0;i<moji.size();i++){
			System.out.println(moji.get(i));
		} int i=0; int i=0; i 0 i<moji.size() i moji.size() moji.size moji i++ i++ i {
			System.out.println(moji.get(i));
		} {
			System.out.println(moji.get(i));
		} System.out.println(moji.get(i)) System.out.println System.out System System.out moji.get(i) moji.get moji i String args[] args
import java.util.*;

class Main {
    // 
    static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intの最大値 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<String,Integer> str = new HashMap<String,Integer>();
        for(int i = 0;i < n;i++){
            String s = sc.next();
            if(str.containsKey(s)){
                int tmp = str.get(s);
                tmp++;
                str.put(s, tmp);
            }else{
                str.put(s, 1);
            }
        }
        int high = 0;
        int count = 0;
        for(int i:str.values()){
            if(high < i)high = i;
        }
        for(int i:str.values()){
            if(high == i)count++;
        }
        
        List moji = new ArrayList<String>();
        for(Map.Entry<String,Integer> entry:str.entrySet()){
            if(entry.getValue()==high){
                //System.out.println(entry.getKey());
                moji.add(entry.getKey());
            }
        }
        Collections.sort(moji);
        for(int i=0;i<moji.size();i++){
			System.out.println(moji.get(i));
		}
    }

}