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

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();

		String S[] = new String[N];
		ArrayList<String>ans = new ArrayList<String>();

		for (int i=0; i<N; i++){
			S[i] = sc.next();
		}
		Arrays.sort(S);
		int maxCnt=0;
		HashMap<String, Integer>map = new HashMap<String, Integer>();
		for (int i=0; i<N; i++){
			if (map.containsKey(S[i])){
				map.put(S[i], map.get(S[i]) + 1);
			} else {
				map.put(S[i], 1);
			}
			maxCnt = Math.max(maxCnt, map.get(S[i]));
		}
		for (String key : map.keySet()){
			if (map.get(key) == maxCnt){
				ans.add(key);
			}
		}
		Collections.sort(ans);
		for (int i=0; i<ans.size(); i++){
			System.out.println(ans.get(i));
		}
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap 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();

		String S[] = new String[N];
		ArrayList<String>ans = new ArrayList<String>();

		for (int i=0; i<N; i++){
			S[i] = sc.next();
		}
		Arrays.sort(S);
		int maxCnt=0;
		HashMap<String, Integer>map = new HashMap<String, Integer>();
		for (int i=0; i<N; i++){
			if (map.containsKey(S[i])){
				map.put(S[i], map.get(S[i]) + 1);
			} else {
				map.put(S[i], 1);
			}
			maxCnt = Math.max(maxCnt, map.get(S[i]));
		}
		for (String key : map.keySet()){
			if (map.get(key) == maxCnt){
				ans.add(key);
			}
		}
		Collections.sort(ans);
		for (int i=0; i<ans.size(); i++){
			System.out.println(ans.get(i));
		}
	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();

		String S[] = new String[N];
		ArrayList<String>ans = new ArrayList<String>();

		for (int i=0; i<N; i++){
			S[i] = sc.next();
		}
		Arrays.sort(S);
		int maxCnt=0;
		HashMap<String, Integer>map = new HashMap<String, Integer>();
		for (int i=0; i<N; i++){
			if (map.containsKey(S[i])){
				map.put(S[i], map.get(S[i]) + 1);
			} else {
				map.put(S[i], 1);
			}
			maxCnt = Math.max(maxCnt, map.get(S[i]));
		}
		for (String key : map.keySet()){
			if (map.get(key) == maxCnt){
				ans.add(key);
			}
		}
		Collections.sort(ans);
		for (int i=0; i<ans.size(); i++){
			System.out.println(ans.get(i));
		}
	} main {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();

		String S[] = new String[N];
		ArrayList<String>ans = new ArrayList<String>();

		for (int i=0; i<N; i++){
			S[i] = sc.next();
		}
		Arrays.sort(S);
		int maxCnt=0;
		HashMap<String, Integer>map = new HashMap<String, Integer>();
		for (int i=0; i<N; i++){
			if (map.containsKey(S[i])){
				map.put(S[i], map.get(S[i]) + 1);
			} else {
				map.put(S[i], 1);
			}
			maxCnt = Math.max(maxCnt, map.get(S[i]));
		}
		for (String key : map.keySet()){
			if (map.get(key) == maxCnt){
				ans.add(key);
			}
		}
		Collections.sort(ans);
		for (int i=0; i<ans.size(); i++){
			System.out.println(ans.get(i));
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc String S[] = new String[N]; S new String[N] N ArrayList<String>ans = new ArrayList<String>(); ans new ArrayList<String>() 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 Arrays.sort(S) Arrays.sort Arrays S int maxCnt=0; maxCnt 0 HashMap<String, Integer>map = new HashMap<String, Integer>(); map new HashMap<String, Integer>() for (int i=0; i<N; i++){
			if (map.containsKey(S[i])){
				map.put(S[i], map.get(S[i]) + 1);
			} else {
				map.put(S[i], 1);
			}
			maxCnt = Math.max(maxCnt, map.get(S[i]));
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			if (map.containsKey(S[i])){
				map.put(S[i], map.get(S[i]) + 1);
			} else {
				map.put(S[i], 1);
			}
			maxCnt = Math.max(maxCnt, map.get(S[i]));
		} {
			if (map.containsKey(S[i])){
				map.put(S[i], map.get(S[i]) + 1);
			} else {
				map.put(S[i], 1);
			}
			maxCnt = Math.max(maxCnt, map.get(S[i]));
		} if (map.containsKey(S[i])){
				map.put(S[i], map.get(S[i]) + 1);
			} else {
				map.put(S[i], 1);
			} map.containsKey(S[i]) map.containsKey map S[i] S i {
				map.put(S[i], map.get(S[i]) + 1);
			} map.put(S[i], map.get(S[i]) + 1) map.put map S[i] S i map.get(S[i]) + 1 map.get(S[i]) map.get map S[i] S i 1 {
				map.put(S[i], 1);
			} map.put(S[i], 1) map.put map S[i] S i 1 maxCnt = Math.max(maxCnt, map.get(S[i])) maxCnt Math.max(maxCnt, map.get(S[i])) Math.max Math maxCnt map.get(S[i]) map.get map S[i] S i for (String key : map.keySet()){
			if (map.get(key) == maxCnt){
				ans.add(key);
			}
		} String key map.keySet() map.keySet map {
			if (map.get(key) == maxCnt){
				ans.add(key);
			}
		} {
			if (map.get(key) == maxCnt){
				ans.add(key);
			}
		} if (map.get(key) == maxCnt){
				ans.add(key);
			} map.get(key) == maxCnt map.get(key) map.get map key maxCnt {
				ans.add(key);
			} ans.add(key) ans.add ans key Collections.sort(ans) Collections.sort Collections ans for (int i=0; i<ans.size(); i++){
			System.out.println(ans.get(i));
		} int i=0; int i=0; i 0 i<ans.size() i ans.size() ans.size ans i++ i++ i {
			System.out.println(ans.get(i));
		} {
			System.out.println(ans.get(i));
		} System.out.println(ans.get(i)) System.out.println System.out System System.out ans.get(i) ans.get ans i String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();

		String S[] = new String[N];
		ArrayList<String>ans = new ArrayList<String>();

		for (int i=0; i<N; i++){
			S[i] = sc.next();
		}
		Arrays.sort(S);
		int maxCnt=0;
		HashMap<String, Integer>map = new HashMap<String, Integer>();
		for (int i=0; i<N; i++){
			if (map.containsKey(S[i])){
				map.put(S[i], map.get(S[i]) + 1);
			} else {
				map.put(S[i], 1);
			}
			maxCnt = Math.max(maxCnt, map.get(S[i]));
		}
		for (String key : map.keySet()){
			if (map.get(key) == maxCnt){
				ans.add(key);
			}
		}
		Collections.sort(ans);
		for (int i=0; i<ans.size(); i++){
			System.out.println(ans.get(i));
		}
	}
} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();

		String S[] = new String[N];
		ArrayList<String>ans = new ArrayList<String>();

		for (int i=0; i<N; i++){
			S[i] = sc.next();
		}
		Arrays.sort(S);
		int maxCnt=0;
		HashMap<String, Integer>map = new HashMap<String, Integer>();
		for (int i=0; i<N; i++){
			if (map.containsKey(S[i])){
				map.put(S[i], map.get(S[i]) + 1);
			} else {
				map.put(S[i], 1);
			}
			maxCnt = Math.max(maxCnt, map.get(S[i]));
		}
		for (String key : map.keySet()){
			if (map.get(key) == maxCnt){
				ans.add(key);
			}
		}
		Collections.sort(ans);
		for (int i=0; i<ans.size(); i++){
			System.out.println(ans.get(i));
		}
	}
} Main
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();

		String S[] = new String[N];
		ArrayList<String>ans = new ArrayList<String>();

		for (int i=0; i<N; i++){
			S[i] = sc.next();
		}
		Arrays.sort(S);
		int maxCnt=0;
		HashMap<String, Integer>map = new HashMap<String, Integer>();
		for (int i=0; i<N; i++){
			if (map.containsKey(S[i])){
				map.put(S[i], map.get(S[i]) + 1);
			} else {
				map.put(S[i], 1);
			}
			maxCnt = Math.max(maxCnt, map.get(S[i]));
		}
		for (String key : map.keySet()){
			if (map.get(key) == maxCnt){
				ans.add(key);
			}
		}
		Collections.sort(ans);
		for (int i=0; i<ans.size(); i++){
			System.out.println(ans.get(i));
		}
	}
}