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

 
public class Main {
 
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		List<String> stringList = new ArrayList<>();
		List<String> ansList = new ArrayList<>();
		
		for(int i = 0; i < N; i++) {
			stringList.add(sc.next()); 
		}
		
		Collections.sort(stringList);
		
		String temp = stringList.get(0);
		int sameCount = 1;
		int maxCount = 0;

		//　最多回数を取得
		for(int i = 1; i < N; i++) {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount < sameCount) {
					maxCount = sameCount;
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		}
		// 全て同じ文字だった場合の最多回数を取得
		if(maxCount < sameCount) {
			maxCount = sameCount;
		}

		// 最多回数と同じ文字列を取得
		sameCount = 1;
		temp = stringList.get(0);
		for(int i = 1; i < N; i++) {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount == sameCount) {
					ansList.add(temp);
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		}
		
		// 最後の文字が最多かどうか確認
		if(maxCount == sameCount) {
			ansList.add(temp);
		}

		for(int i = 0; i < ansList.size(); i++) {
			System.out.println(ansList.get(i));
		}
		
		sc.close();
	}
	
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections 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) {
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		List<String> stringList = new ArrayList<>();
		List<String> ansList = new ArrayList<>();
		
		for(int i = 0; i < N; i++) {
			stringList.add(sc.next()); 
		}
		
		Collections.sort(stringList);
		
		String temp = stringList.get(0);
		int sameCount = 1;
		int maxCount = 0;

		//　最多回数を取得
		for(int i = 1; i < N; i++) {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount < sameCount) {
					maxCount = sameCount;
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		}
		// 全て同じ文字だった場合の最多回数を取得
		if(maxCount < sameCount) {
			maxCount = sameCount;
		}

		// 最多回数と同じ文字列を取得
		sameCount = 1;
		temp = stringList.get(0);
		for(int i = 1; i < N; i++) {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount == sameCount) {
					ansList.add(temp);
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		}
		
		// 最後の文字が最多かどうか確認
		if(maxCount == sameCount) {
			ansList.add(temp);
		}

		for(int i = 0; i < ansList.size(); i++) {
			System.out.println(ansList.get(i));
		}
		
		sc.close();
	}
	
} Main public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		List<String> stringList = new ArrayList<>();
		List<String> ansList = new ArrayList<>();
		
		for(int i = 0; i < N; i++) {
			stringList.add(sc.next()); 
		}
		
		Collections.sort(stringList);
		
		String temp = stringList.get(0);
		int sameCount = 1;
		int maxCount = 0;

		//　最多回数を取得
		for(int i = 1; i < N; i++) {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount < sameCount) {
					maxCount = sameCount;
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		}
		// 全て同じ文字だった場合の最多回数を取得
		if(maxCount < sameCount) {
			maxCount = sameCount;
		}

		// 最多回数と同じ文字列を取得
		sameCount = 1;
		temp = stringList.get(0);
		for(int i = 1; i < N; i++) {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount == sameCount) {
					ansList.add(temp);
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		}
		
		// 最後の文字が最多かどうか確認
		if(maxCount == sameCount) {
			ansList.add(temp);
		}

		for(int i = 0; i < ansList.size(); i++) {
			System.out.println(ansList.get(i));
		}
		
		sc.close();
	} main {
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		List<String> stringList = new ArrayList<>();
		List<String> ansList = new ArrayList<>();
		
		for(int i = 0; i < N; i++) {
			stringList.add(sc.next()); 
		}
		
		Collections.sort(stringList);
		
		String temp = stringList.get(0);
		int sameCount = 1;
		int maxCount = 0;

		//　最多回数を取得
		for(int i = 1; i < N; i++) {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount < sameCount) {
					maxCount = sameCount;
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		}
		// 全て同じ文字だった場合の最多回数を取得
		if(maxCount < sameCount) {
			maxCount = sameCount;
		}

		// 最多回数と同じ文字列を取得
		sameCount = 1;
		temp = stringList.get(0);
		for(int i = 1; i < N; i++) {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount == sameCount) {
					ansList.add(temp);
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		}
		
		// 最後の文字が最多かどうか確認
		if(maxCount == sameCount) {
			ansList.add(temp);
		}

		for(int i = 0; i < ansList.size(); i++) {
			System.out.println(ansList.get(i));
		}
		
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc List<String> stringList = new ArrayList<>(); stringList new ArrayList<>() List<String> ansList = new ArrayList<>(); ansList new ArrayList<>() for(int i = 0; i < N; i++) {
			stringList.add(sc.next()); 
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			stringList.add(sc.next()); 
		} {
			stringList.add(sc.next()); 
		} stringList.add(sc.next()) stringList.add stringList sc.next() sc.next sc Collections.sort(stringList) Collections.sort Collections stringList String temp = stringList.get(0); temp stringList.get(0) stringList.get stringList 0 int sameCount = 1; sameCount 1 int maxCount = 0; maxCount 0 for(int i = 1; i < N; i++) {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount < sameCount) {
					maxCount = sameCount;
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		} int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount < sameCount) {
					maxCount = sameCount;
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		} {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount < sameCount) {
					maxCount = sameCount;
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		} if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount < sameCount) {
					maxCount = sameCount;
				}
				sameCount = 1;
				temp = stringList.get(i);
			} temp.equals(stringList.get(i)) temp.equals temp stringList.get(i) stringList.get stringList i {
				sameCount++;
			} sameCount++ sameCount {
				if(maxCount < sameCount) {
					maxCount = sameCount;
				}
				sameCount = 1;
				temp = stringList.get(i);
			} if(maxCount < sameCount) {
					maxCount = sameCount;
				} maxCount < sameCount maxCount sameCount {
					maxCount = sameCount;
				} maxCount = sameCount maxCount sameCount sameCount = 1 sameCount 1 temp = stringList.get(i) temp stringList.get(i) stringList.get stringList i if(maxCount < sameCount) {
			maxCount = sameCount;
		} maxCount < sameCount maxCount sameCount {
			maxCount = sameCount;
		} maxCount = sameCount maxCount sameCount sameCount = 1 sameCount 1 temp = stringList.get(0) temp stringList.get(0) stringList.get stringList 0 for(int i = 1; i < N; i++) {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount == sameCount) {
					ansList.add(temp);
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		} int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount == sameCount) {
					ansList.add(temp);
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		} {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount == sameCount) {
					ansList.add(temp);
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		} if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount == sameCount) {
					ansList.add(temp);
				}
				sameCount = 1;
				temp = stringList.get(i);
			} temp.equals(stringList.get(i)) temp.equals temp stringList.get(i) stringList.get stringList i {
				sameCount++;
			} sameCount++ sameCount {
				if(maxCount == sameCount) {
					ansList.add(temp);
				}
				sameCount = 1;
				temp = stringList.get(i);
			} if(maxCount == sameCount) {
					ansList.add(temp);
				} maxCount == sameCount maxCount sameCount {
					ansList.add(temp);
				} ansList.add(temp) ansList.add ansList temp sameCount = 1 sameCount 1 temp = stringList.get(i) temp stringList.get(i) stringList.get stringList i if(maxCount == sameCount) {
			ansList.add(temp);
		} maxCount == sameCount maxCount sameCount {
			ansList.add(temp);
		} ansList.add(temp) ansList.add ansList temp for(int i = 0; i < ansList.size(); i++) {
			System.out.println(ansList.get(i));
		} int i = 0; int i = 0; i 0 i < ansList.size() i ansList.size() ansList.size ansList i++ i++ i {
			System.out.println(ansList.get(i));
		} {
			System.out.println(ansList.get(i));
		} System.out.println(ansList.get(i)) System.out.println System.out System System.out ansList.get(i) ansList.get ansList i sc.close() sc.close sc String[] args args public class Main {
 
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		List<String> stringList = new ArrayList<>();
		List<String> ansList = new ArrayList<>();
		
		for(int i = 0; i < N; i++) {
			stringList.add(sc.next()); 
		}
		
		Collections.sort(stringList);
		
		String temp = stringList.get(0);
		int sameCount = 1;
		int maxCount = 0;

		//　最多回数を取得
		for(int i = 1; i < N; i++) {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount < sameCount) {
					maxCount = sameCount;
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		}
		// 全て同じ文字だった場合の最多回数を取得
		if(maxCount < sameCount) {
			maxCount = sameCount;
		}

		// 最多回数と同じ文字列を取得
		sameCount = 1;
		temp = stringList.get(0);
		for(int i = 1; i < N; i++) {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount == sameCount) {
					ansList.add(temp);
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		}
		
		// 最後の文字が最多かどうか確認
		if(maxCount == sameCount) {
			ansList.add(temp);
		}

		for(int i = 0; i < ansList.size(); i++) {
			System.out.println(ansList.get(i));
		}
		
		sc.close();
	}
	
} public class Main {
 
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		List<String> stringList = new ArrayList<>();
		List<String> ansList = new ArrayList<>();
		
		for(int i = 0; i < N; i++) {
			stringList.add(sc.next()); 
		}
		
		Collections.sort(stringList);
		
		String temp = stringList.get(0);
		int sameCount = 1;
		int maxCount = 0;

		//　最多回数を取得
		for(int i = 1; i < N; i++) {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount < sameCount) {
					maxCount = sameCount;
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		}
		// 全て同じ文字だった場合の最多回数を取得
		if(maxCount < sameCount) {
			maxCount = sameCount;
		}

		// 最多回数と同じ文字列を取得
		sameCount = 1;
		temp = stringList.get(0);
		for(int i = 1; i < N; i++) {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount == sameCount) {
					ansList.add(temp);
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		}
		
		// 最後の文字が最多かどうか確認
		if(maxCount == sameCount) {
			ansList.add(temp);
		}

		for(int i = 0; i < ansList.size(); i++) {
			System.out.println(ansList.get(i));
		}
		
		sc.close();
	}
	
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

 
public class Main {
 
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		List<String> stringList = new ArrayList<>();
		List<String> ansList = new ArrayList<>();
		
		for(int i = 0; i < N; i++) {
			stringList.add(sc.next()); 
		}
		
		Collections.sort(stringList);
		
		String temp = stringList.get(0);
		int sameCount = 1;
		int maxCount = 0;

		//　最多回数を取得
		for(int i = 1; i < N; i++) {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount < sameCount) {
					maxCount = sameCount;
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		}
		// 全て同じ文字だった場合の最多回数を取得
		if(maxCount < sameCount) {
			maxCount = sameCount;
		}

		// 最多回数と同じ文字列を取得
		sameCount = 1;
		temp = stringList.get(0);
		for(int i = 1; i < N; i++) {
			if(temp.equals(stringList.get(i))) {
				sameCount++;
			}else {
				if(maxCount == sameCount) {
					ansList.add(temp);
				}
				sameCount = 1;
				temp = stringList.get(i);
			}
		}
		
		// 最後の文字が最多かどうか確認
		if(maxCount == sameCount) {
			ansList.add(temp);
		}

		for(int i = 0; i < ansList.size(); i++) {
			System.out.println(ansList.get(i));
		}
		
		sc.close();
	}
	
}