import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int N;
    String[] S;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        S = new String[N];
        for (int i=0; i<N; i++) {
        	S[i] = sc.next();
        }
    }
    
    //解答処理
    private List<String> solve() {
    	int max = 0;
    	HashMap<String,Integer> map = new HashMap<String,Integer>();
    	List<String> list = new ArrayList<String>();
    	
    	for (int i=0; i<N; i++) {
    		int count = 1;
    		if (map.containsKey(S[i])) {
    			count += map.get(S[i]);
    		}
    		map.put(S[i], count);
    	}
    	
    	for (String s : map.keySet()) {
    		max = Math.max(max, map.get(s));
    	}
    	for (String s : map.keySet()) {
    		if (max == map.get(s)) {
				list.add(s);
			}
    	}
        
    	Collections.sort(list);
        return list;
    }
    
    //出力
    public void show(List<String> answer) {
    	for (String s : answer) {
    		System.out.println(s);  		
    	}
    }

} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int N;
    String[] S;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        S = new String[N];
        for (int i=0; i<N; i++) {
        	S[i] = sc.next();
        }
    }
    
    //解答処理
    private List<String> solve() {
    	int max = 0;
    	HashMap<String,Integer> map = new HashMap<String,Integer>();
    	List<String> list = new ArrayList<String>();
    	
    	for (int i=0; i<N; i++) {
    		int count = 1;
    		if (map.containsKey(S[i])) {
    			count += map.get(S[i]);
    		}
    		map.put(S[i], count);
    	}
    	
    	for (String s : map.keySet()) {
    		max = Math.max(max, map.get(s));
    	}
    	for (String s : map.keySet()) {
    		if (max == map.get(s)) {
				list.add(s);
			}
    	}
        
    	Collections.sort(list);
        return list;
    }
    
    //出力
    public void show(List<String> answer) {
    	for (String s : answer) {
    		System.out.println(s);  		
    	}
    }

} Main //フィールド
    Scanner sc; sc int N; N String[] S; S public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Main m = new Main(sc); m new Main(sc) m.show(m.solve()) m.show m m.solve() m.solve m sc.close() sc.close sc String[] args args //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        S = new String[N];
        for (int i=0; i<N; i++) {
        	S[i] = sc.next();
        }
    } Main {
        this.sc = sc;
        this.N = sc.nextInt();
        S = new String[N];
        for (int i=0; i<N; i++) {
        	S[i] = sc.next();
        }
    } this.sc = sc this.sc this this.sc sc this.N = sc.nextInt() this.N this this.N sc.nextInt() sc.nextInt sc S = new String[N] S new String[N] N for (int i=0; i<N; i++) {
        	S[i] = sc.next();
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
        	S[i] = sc.next();
        } {
        	S[i] = sc.next();
        } S[i] = sc.next() S[i] S i sc.next() sc.next sc Scanner sc sc //解答処理
    private List<String> solve() {
    	int max = 0;
    	HashMap<String,Integer> map = new HashMap<String,Integer>();
    	List<String> list = new ArrayList<String>();
    	
    	for (int i=0; i<N; i++) {
    		int count = 1;
    		if (map.containsKey(S[i])) {
    			count += map.get(S[i]);
    		}
    		map.put(S[i], count);
    	}
    	
    	for (String s : map.keySet()) {
    		max = Math.max(max, map.get(s));
    	}
    	for (String s : map.keySet()) {
    		if (max == map.get(s)) {
				list.add(s);
			}
    	}
        
    	Collections.sort(list);
        return list;
    } solve {
    	int max = 0;
    	HashMap<String,Integer> map = new HashMap<String,Integer>();
    	List<String> list = new ArrayList<String>();
    	
    	for (int i=0; i<N; i++) {
    		int count = 1;
    		if (map.containsKey(S[i])) {
    			count += map.get(S[i]);
    		}
    		map.put(S[i], count);
    	}
    	
    	for (String s : map.keySet()) {
    		max = Math.max(max, map.get(s));
    	}
    	for (String s : map.keySet()) {
    		if (max == map.get(s)) {
				list.add(s);
			}
    	}
        
    	Collections.sort(list);
        return list;
    } int max = 0; max 0 HashMap<String,Integer> map = new HashMap<String,Integer>(); map new HashMap<String,Integer>() List<String> list = new ArrayList<String>(); list new ArrayList<String>() for (int i=0; i<N; i++) {
    		int count = 1;
    		if (map.containsKey(S[i])) {
    			count += map.get(S[i]);
    		}
    		map.put(S[i], count);
    	} int i=0; int i=0; i 0 i<N i N i++ i++ i {
    		int count = 1;
    		if (map.containsKey(S[i])) {
    			count += map.get(S[i]);
    		}
    		map.put(S[i], count);
    	} {
    		int count = 1;
    		if (map.containsKey(S[i])) {
    			count += map.get(S[i]);
    		}
    		map.put(S[i], count);
    	} int count = 1; count 1 if (map.containsKey(S[i])) {
    			count += map.get(S[i]);
    		} map.containsKey(S[i]) map.containsKey map S[i] S i {
    			count += map.get(S[i]);
    		} count += map.get(S[i]) count map.get(S[i]) map.get map S[i] S i map.put(S[i], count) map.put map S[i] S i count 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 for (String s : map.keySet()) {
    		if (max == map.get(s)) {
				list.add(s);
			}
    	} String s map.keySet() map.keySet map {
    		if (max == map.get(s)) {
				list.add(s);
			}
    	} {
    		if (max == map.get(s)) {
				list.add(s);
			}
    	} if (max == map.get(s)) {
				list.add(s);
			} max == map.get(s) max map.get(s) map.get map s {
				list.add(s);
			} list.add(s) list.add list s Collections.sort(list) Collections.sort Collections list return list; list //出力
    public void show(List<String> answer) {
    	for (String s : answer) {
    		System.out.println(s);  		
    	}
    } show {
    	for (String s : answer) {
    		System.out.println(s);  		
    	}
    } for (String s : answer) {
    		System.out.println(s);  		
    	} String s answer {
    		System.out.println(s);  		
    	} {
    		System.out.println(s);  		
    	} System.out.println(s) System.out.println System.out System System.out s List<String> answer answer public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int N;
    String[] S;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        S = new String[N];
        for (int i=0; i<N; i++) {
        	S[i] = sc.next();
        }
    }
    
    //解答処理
    private List<String> solve() {
    	int max = 0;
    	HashMap<String,Integer> map = new HashMap<String,Integer>();
    	List<String> list = new ArrayList<String>();
    	
    	for (int i=0; i<N; i++) {
    		int count = 1;
    		if (map.containsKey(S[i])) {
    			count += map.get(S[i]);
    		}
    		map.put(S[i], count);
    	}
    	
    	for (String s : map.keySet()) {
    		max = Math.max(max, map.get(s));
    	}
    	for (String s : map.keySet()) {
    		if (max == map.get(s)) {
				list.add(s);
			}
    	}
        
    	Collections.sort(list);
        return list;
    }
    
    //出力
    public void show(List<String> answer) {
    	for (String s : answer) {
    		System.out.println(s);  		
    	}
    }

} public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int N;
    String[] S;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        S = new String[N];
        for (int i=0; i<N; i++) {
        	S[i] = sc.next();
        }
    }
    
    //解答処理
    private List<String> solve() {
    	int max = 0;
    	HashMap<String,Integer> map = new HashMap<String,Integer>();
    	List<String> list = new ArrayList<String>();
    	
    	for (int i=0; i<N; i++) {
    		int count = 1;
    		if (map.containsKey(S[i])) {
    			count += map.get(S[i]);
    		}
    		map.put(S[i], count);
    	}
    	
    	for (String s : map.keySet()) {
    		max = Math.max(max, map.get(s));
    	}
    	for (String s : map.keySet()) {
    		if (max == map.get(s)) {
				list.add(s);
			}
    	}
        
    	Collections.sort(list);
        return list;
    }
    
    //出力
    public void show(List<String> answer) {
    	for (String s : answer) {
    		System.out.println(s);  		
    	}
    }

} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int N;
    String[] S;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        S = new String[N];
        for (int i=0; i<N; i++) {
        	S[i] = sc.next();
        }
    }
    
    //解答処理
    private List<String> solve() {
    	int max = 0;
    	HashMap<String,Integer> map = new HashMap<String,Integer>();
    	List<String> list = new ArrayList<String>();
    	
    	for (int i=0; i<N; i++) {
    		int count = 1;
    		if (map.containsKey(S[i])) {
    			count += map.get(S[i]);
    		}
    		map.put(S[i], count);
    	}
    	
    	for (String s : map.keySet()) {
    		max = Math.max(max, map.get(s));
    	}
    	for (String s : map.keySet()) {
    		if (max == map.get(s)) {
				list.add(s);
			}
    	}
        
    	Collections.sort(list);
        return list;
    }
    
    //出力
    public void show(List<String> answer) {
    	for (String s : answer) {
    		System.out.println(s);  		
    	}
    }

}
