

import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int N = Integer.parseInt(br.readLine());
		
		//キーがStringで中身がintのMapを作る（Map内では自動でソートされる）
		Map<String, Integer> count = new TreeMap<String, Integer>();
		for (int s=0; s<N; s++) {
			String S = br.readLine();
			if (count.containsKey(S)) { //Mapに既にキーがあるとき
				int now = count.get(S); //キーSに紐づく中身のintを取得
				count.replace(S, now + 1);
			}
			else {
				count.put(S, 1); //まだMapにキーが登録されていないなら、登録する
			}
		}
		
		int Max = 0;
		for (int val: count.values()) { 
			if (Max <= val) {
				Max = val;
			}
		}
		
		StringWriter s = new StringWriter();
	    for (Map.Entry<String, Integer> e :count.entrySet()){
	    	if (e.getValue() == Max) {
	    		s.append(e.getKey() + '\n');
	    	}
	    }
	    System.out.println(s.toString());
	}
	
} import java.util.*; util.* java import java.io.*; io.* java public class Main {

	public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int N = Integer.parseInt(br.readLine());
		
		//キーがStringで中身がintのMapを作る（Map内では自動でソートされる）
		Map<String, Integer> count = new TreeMap<String, Integer>();
		for (int s=0; s<N; s++) {
			String S = br.readLine();
			if (count.containsKey(S)) { //Mapに既にキーがあるとき
				int now = count.get(S); //キーSに紐づく中身のintを取得
				count.replace(S, now + 1);
			}
			else {
				count.put(S, 1); //まだMapにキーが登録されていないなら、登録する
			}
		}
		
		int Max = 0;
		for (int val: count.values()) { 
			if (Max <= val) {
				Max = val;
			}
		}
		
		StringWriter s = new StringWriter();
	    for (Map.Entry<String, Integer> e :count.entrySet()){
	    	if (e.getValue() == Max) {
	    		s.append(e.getKey() + '\n');
	    	}
	    }
	    System.out.println(s.toString());
	}
	
} Main public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int N = Integer.parseInt(br.readLine());
		
		//キーがStringで中身がintのMapを作る（Map内では自動でソートされる）
		Map<String, Integer> count = new TreeMap<String, Integer>();
		for (int s=0; s<N; s++) {
			String S = br.readLine();
			if (count.containsKey(S)) { //Mapに既にキーがあるとき
				int now = count.get(S); //キーSに紐づく中身のintを取得
				count.replace(S, now + 1);
			}
			else {
				count.put(S, 1); //まだMapにキーが登録されていないなら、登録する
			}
		}
		
		int Max = 0;
		for (int val: count.values()) { 
			if (Max <= val) {
				Max = val;
			}
		}
		
		StringWriter s = new StringWriter();
	    for (Map.Entry<String, Integer> e :count.entrySet()){
	    	if (e.getValue() == Max) {
	    		s.append(e.getKey() + '\n');
	    	}
	    }
	    System.out.println(s.toString());
	} main {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int N = Integer.parseInt(br.readLine());
		
		//キーがStringで中身がintのMapを作る（Map内では自動でソートされる）
		Map<String, Integer> count = new TreeMap<String, Integer>();
		for (int s=0; s<N; s++) {
			String S = br.readLine();
			if (count.containsKey(S)) { //Mapに既にキーがあるとき
				int now = count.get(S); //キーSに紐づく中身のintを取得
				count.replace(S, now + 1);
			}
			else {
				count.put(S, 1); //まだMapにキーが登録されていないなら、登録する
			}
		}
		
		int Max = 0;
		for (int val: count.values()) { 
			if (Max <= val) {
				Max = val;
			}
		}
		
		StringWriter s = new StringWriter();
	    for (Map.Entry<String, Integer> e :count.entrySet()){
	    	if (e.getValue() == Max) {
	    		s.append(e.getKey() + '\n');
	    	}
	    }
	    System.out.println(s.toString());
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int N = Integer.parseInt(br.readLine()); N Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br Map<String, Integer> count = new TreeMap<String, Integer>(); count new TreeMap<String, Integer>() for (int s=0; s<N; s++) {
			String S = br.readLine();
			if (count.containsKey(S)) { //Mapに既にキーがあるとき
				int now = count.get(S); //キーSに紐づく中身のintを取得
				count.replace(S, now + 1);
			}
			else {
				count.put(S, 1); //まだMapにキーが登録されていないなら、登録する
			}
		} int s=0; int s=0; s 0 s<N s N s++ s++ s {
			String S = br.readLine();
			if (count.containsKey(S)) { //Mapに既にキーがあるとき
				int now = count.get(S); //キーSに紐づく中身のintを取得
				count.replace(S, now + 1);
			}
			else {
				count.put(S, 1); //まだMapにキーが登録されていないなら、登録する
			}
		} {
			String S = br.readLine();
			if (count.containsKey(S)) { //Mapに既にキーがあるとき
				int now = count.get(S); //キーSに紐づく中身のintを取得
				count.replace(S, now + 1);
			}
			else {
				count.put(S, 1); //まだMapにキーが登録されていないなら、登録する
			}
		} String S = br.readLine(); S br.readLine() br.readLine br if (count.containsKey(S)) { //Mapに既にキーがあるとき
				int now = count.get(S); //キーSに紐づく中身のintを取得
				count.replace(S, now + 1);
			}
			else {
				count.put(S, 1); //まだMapにキーが登録されていないなら、登録する
			} count.containsKey(S) count.containsKey count S { //Mapに既にキーがあるとき
				int now = count.get(S); //キーSに紐づく中身のintを取得
				count.replace(S, now + 1);
			} int now = count.get(S); now count.get(S) count.get count S count.replace(S, now + 1) count.replace count S now + 1 now 1 {
				count.put(S, 1); //まだMapにキーが登録されていないなら、登録する
			} count.put(S, 1) count.put count S 1 int Max = 0; Max 0 for (int val: count.values()) { 
			if (Max <= val) {
				Max = val;
			}
		} int val count.values() count.values count { 
			if (Max <= val) {
				Max = val;
			}
		} { 
			if (Max <= val) {
				Max = val;
			}
		} if (Max <= val) {
				Max = val;
			} Max <= val Max val {
				Max = val;
			} Max = val Max val StringWriter s = new StringWriter(); s new StringWriter() for (Map.Entry<String, Integer> e :count.entrySet()){
	    	if (e.getValue() == Max) {
	    		s.append(e.getKey() + '\n');
	    	}
	    } Map.Entry<String, Integer> e count.entrySet() count.entrySet count {
	    	if (e.getValue() == Max) {
	    		s.append(e.getKey() + '\n');
	    	}
	    } {
	    	if (e.getValue() == Max) {
	    		s.append(e.getKey() + '\n');
	    	}
	    } if (e.getValue() == Max) {
	    		s.append(e.getKey() + '\n');
	    	} e.getValue() == Max e.getValue() e.getValue e Max {
	    		s.append(e.getKey() + '\n');
	    	} s.append(e.getKey() + '\n') s.append s e.getKey() + '\n' e.getKey() e.getKey e '\n' System.out.println(s.toString()) System.out.println System.out System System.out s.toString() s.toString s String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int N = Integer.parseInt(br.readLine());
		
		//キーがStringで中身がintのMapを作る（Map内では自動でソートされる）
		Map<String, Integer> count = new TreeMap<String, Integer>();
		for (int s=0; s<N; s++) {
			String S = br.readLine();
			if (count.containsKey(S)) { //Mapに既にキーがあるとき
				int now = count.get(S); //キーSに紐づく中身のintを取得
				count.replace(S, now + 1);
			}
			else {
				count.put(S, 1); //まだMapにキーが登録されていないなら、登録する
			}
		}
		
		int Max = 0;
		for (int val: count.values()) { 
			if (Max <= val) {
				Max = val;
			}
		}
		
		StringWriter s = new StringWriter();
	    for (Map.Entry<String, Integer> e :count.entrySet()){
	    	if (e.getValue() == Max) {
	    		s.append(e.getKey() + '\n');
	    	}
	    }
	    System.out.println(s.toString());
	}
	
} public class Main {

	public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int N = Integer.parseInt(br.readLine());
		
		//キーがStringで中身がintのMapを作る（Map内では自動でソートされる）
		Map<String, Integer> count = new TreeMap<String, Integer>();
		for (int s=0; s<N; s++) {
			String S = br.readLine();
			if (count.containsKey(S)) { //Mapに既にキーがあるとき
				int now = count.get(S); //キーSに紐づく中身のintを取得
				count.replace(S, now + 1);
			}
			else {
				count.put(S, 1); //まだMapにキーが登録されていないなら、登録する
			}
		}
		
		int Max = 0;
		for (int val: count.values()) { 
			if (Max <= val) {
				Max = val;
			}
		}
		
		StringWriter s = new StringWriter();
	    for (Map.Entry<String, Integer> e :count.entrySet()){
	    	if (e.getValue() == Max) {
	    		s.append(e.getKey() + '\n');
	    	}
	    }
	    System.out.println(s.toString());
	}
	
} Main


import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int N = Integer.parseInt(br.readLine());
		
		//キーがStringで中身がintのMapを作る（Map内では自動でソートされる）
		Map<String, Integer> count = new TreeMap<String, Integer>();
		for (int s=0; s<N; s++) {
			String S = br.readLine();
			if (count.containsKey(S)) { //Mapに既にキーがあるとき
				int now = count.get(S); //キーSに紐づく中身のintを取得
				count.replace(S, now + 1);
			}
			else {
				count.put(S, 1); //まだMapにキーが登録されていないなら、登録する
			}
		}
		
		int Max = 0;
		for (int val: count.values()) { 
			if (Max <= val) {
				Max = val;
			}
		}
		
		StringWriter s = new StringWriter();
	    for (Map.Entry<String, Integer> e :count.entrySet()){
	    	if (e.getValue() == Max) {
	    		s.append(e.getKey() + '\n');
	    	}
	    }
	    System.out.println(s.toString());
	}
	
}
