import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		TreeMap<String, Integer> tm = new TreeMap<String, Integer>();
		int max = 0;
		for(int i = 0; i < n; i++){
		    String s = sc.next();
		    int cnt = tm.getOrDefault(s, 0) + 1;
		    tm.put(s, cnt);
		    max = max(max, cnt);
		}
		
		// 計算
		//String result = "Yes";
		for(String key : tm.keySet()){
		    //System.out.println(max);
		    if(tm.get(key).equals(max)) System.out.println(key);
		}
		
		// 出力
		//System.out.println(result);
	}
} import java.util.*; util.* java import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; import java.math.BigInteger; BigInteger java.math public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		TreeMap<String, Integer> tm = new TreeMap<String, Integer>();
		int max = 0;
		for(int i = 0; i < n; i++){
		    String s = sc.next();
		    int cnt = tm.getOrDefault(s, 0) + 1;
		    tm.put(s, cnt);
		    max = max(max, cnt);
		}
		
		// 計算
		//String result = "Yes";
		for(String key : tm.keySet()){
		    //System.out.println(max);
		    if(tm.get(key).equals(max)) System.out.println(key);
		}
		
		// 出力
		//System.out.println(result);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		TreeMap<String, Integer> tm = new TreeMap<String, Integer>();
		int max = 0;
		for(int i = 0; i < n; i++){
		    String s = sc.next();
		    int cnt = tm.getOrDefault(s, 0) + 1;
		    tm.put(s, cnt);
		    max = max(max, cnt);
		}
		
		// 計算
		//String result = "Yes";
		for(String key : tm.keySet()){
		    //System.out.println(max);
		    if(tm.get(key).equals(max)) System.out.println(key);
		}
		
		// 出力
		//System.out.println(result);
	} main {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		TreeMap<String, Integer> tm = new TreeMap<String, Integer>();
		int max = 0;
		for(int i = 0; i < n; i++){
		    String s = sc.next();
		    int cnt = tm.getOrDefault(s, 0) + 1;
		    tm.put(s, cnt);
		    max = max(max, cnt);
		}
		
		// 計算
		//String result = "Yes";
		for(String key : tm.keySet()){
		    //System.out.println(max);
		    if(tm.get(key).equals(max)) System.out.println(key);
		}
		
		// 出力
		//System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc TreeMap<String, Integer> tm = new TreeMap<String, Integer>(); tm new TreeMap<String, Integer>() int max = 0; max 0 for(int i = 0; i < n; i++){
		    String s = sc.next();
		    int cnt = tm.getOrDefault(s, 0) + 1;
		    tm.put(s, cnt);
		    max = max(max, cnt);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
		    String s = sc.next();
		    int cnt = tm.getOrDefault(s, 0) + 1;
		    tm.put(s, cnt);
		    max = max(max, cnt);
		} {
		    String s = sc.next();
		    int cnt = tm.getOrDefault(s, 0) + 1;
		    tm.put(s, cnt);
		    max = max(max, cnt);
		} String s = sc.next(); s sc.next() sc.next sc int cnt = tm.getOrDefault(s, 0) + 1; cnt tm.getOrDefault(s, 0) + 1 tm.getOrDefault(s, 0) tm.getOrDefault tm s 0 1 tm.put(s, cnt) tm.put tm s cnt max = max(max, cnt) max max(max, cnt) max max cnt for(String key : tm.keySet()){
		    //System.out.println(max);
		    if(tm.get(key).equals(max)) System.out.println(key);
		} String key tm.keySet() tm.keySet tm {
		    //System.out.println(max);
		    if(tm.get(key).equals(max)) System.out.println(key);
		} {
		    //System.out.println(max);
		    if(tm.get(key).equals(max)) System.out.println(key);
		} if(tm.get(key).equals(max)) System.out.println(key); tm.get(key).equals(max) tm.get(key).equals tm.get(key) tm.get tm key max System.out.println(key) System.out.println System.out System System.out key String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		TreeMap<String, Integer> tm = new TreeMap<String, Integer>();
		int max = 0;
		for(int i = 0; i < n; i++){
		    String s = sc.next();
		    int cnt = tm.getOrDefault(s, 0) + 1;
		    tm.put(s, cnt);
		    max = max(max, cnt);
		}
		
		// 計算
		//String result = "Yes";
		for(String key : tm.keySet()){
		    //System.out.println(max);
		    if(tm.get(key).equals(max)) System.out.println(key);
		}
		
		// 出力
		//System.out.println(result);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		TreeMap<String, Integer> tm = new TreeMap<String, Integer>();
		int max = 0;
		for(int i = 0; i < n; i++){
		    String s = sc.next();
		    int cnt = tm.getOrDefault(s, 0) + 1;
		    tm.put(s, cnt);
		    max = max(max, cnt);
		}
		
		// 計算
		//String result = "Yes";
		for(String key : tm.keySet()){
		    //System.out.println(max);
		    if(tm.get(key).equals(max)) System.out.println(key);
		}
		
		// 出力
		//System.out.println(result);
	}
} Main
import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		TreeMap<String, Integer> tm = new TreeMap<String, Integer>();
		int max = 0;
		for(int i = 0; i < n; i++){
		    String s = sc.next();
		    int cnt = tm.getOrDefault(s, 0) + 1;
		    tm.put(s, cnt);
		    max = max(max, cnt);
		}
		
		// 計算
		//String result = "Yes";
		for(String key : tm.keySet()){
		    //System.out.println(max);
		    if(tm.get(key).equals(max)) System.out.println(key);
		}
		
		// 出力
		//System.out.println(result);
	}
}
