import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 1;
		int max = 0;
		String[] S = new String[N];
		for(int i = 0;i < N;i++){
			S[i] = sc.next();
		}
		Arrays.sort(S);
		Map<String,Integer> map = new TreeMap<>();
		for(int i = 0;i < N - 1;i++){
			if(S[i + 1].equals(S[i])){
				count++;
				if(i == N - 2){
					map.put(S[i],count);
					max = Math.max(max,count);
				}
			}else{
				map.put(S[i],count);
				max = Math.max(max,count);
				count = 1;
				if(i == N - 2){
					map.put(S[i + 1],count);
					max = Math.max(max,count);
				}
			}
		}
		for(String key : map.keySet()){
			if(map.get(key) == max){
				System.out.println(key);
			}
		}
	}
} import java.util.*; util.* java public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 1;
		int max = 0;
		String[] S = new String[N];
		for(int i = 0;i < N;i++){
			S[i] = sc.next();
		}
		Arrays.sort(S);
		Map<String,Integer> map = new TreeMap<>();
		for(int i = 0;i < N - 1;i++){
			if(S[i + 1].equals(S[i])){
				count++;
				if(i == N - 2){
					map.put(S[i],count);
					max = Math.max(max,count);
				}
			}else{
				map.put(S[i],count);
				max = Math.max(max,count);
				count = 1;
				if(i == N - 2){
					map.put(S[i + 1],count);
					max = Math.max(max,count);
				}
			}
		}
		for(String key : map.keySet()){
			if(map.get(key) == max){
				System.out.println(key);
			}
		}
	}
} Main public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 1;
		int max = 0;
		String[] S = new String[N];
		for(int i = 0;i < N;i++){
			S[i] = sc.next();
		}
		Arrays.sort(S);
		Map<String,Integer> map = new TreeMap<>();
		for(int i = 0;i < N - 1;i++){
			if(S[i + 1].equals(S[i])){
				count++;
				if(i == N - 2){
					map.put(S[i],count);
					max = Math.max(max,count);
				}
			}else{
				map.put(S[i],count);
				max = Math.max(max,count);
				count = 1;
				if(i == N - 2){
					map.put(S[i + 1],count);
					max = Math.max(max,count);
				}
			}
		}
		for(String key : map.keySet()){
			if(map.get(key) == max){
				System.out.println(key);
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 1;
		int max = 0;
		String[] S = new String[N];
		for(int i = 0;i < N;i++){
			S[i] = sc.next();
		}
		Arrays.sort(S);
		Map<String,Integer> map = new TreeMap<>();
		for(int i = 0;i < N - 1;i++){
			if(S[i + 1].equals(S[i])){
				count++;
				if(i == N - 2){
					map.put(S[i],count);
					max = Math.max(max,count);
				}
			}else{
				map.put(S[i],count);
				max = Math.max(max,count);
				count = 1;
				if(i == N - 2){
					map.put(S[i + 1],count);
					max = Math.max(max,count);
				}
			}
		}
		for(String key : map.keySet()){
			if(map.get(key) == max){
				System.out.println(key);
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int count = 1; count 1 int max = 0; max 0 String[] 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 Arrays.sort(S) Arrays.sort Arrays S Map<String,Integer> map = new TreeMap<>(); map new TreeMap<>() for(int i = 0;i < N - 1;i++){
			if(S[i + 1].equals(S[i])){
				count++;
				if(i == N - 2){
					map.put(S[i],count);
					max = Math.max(max,count);
				}
			}else{
				map.put(S[i],count);
				max = Math.max(max,count);
				count = 1;
				if(i == N - 2){
					map.put(S[i + 1],count);
					max = Math.max(max,count);
				}
			}
		} int i = 0; int i = 0; i 0 i < N - 1 i N - 1 N 1 i++ i++ i {
			if(S[i + 1].equals(S[i])){
				count++;
				if(i == N - 2){
					map.put(S[i],count);
					max = Math.max(max,count);
				}
			}else{
				map.put(S[i],count);
				max = Math.max(max,count);
				count = 1;
				if(i == N - 2){
					map.put(S[i + 1],count);
					max = Math.max(max,count);
				}
			}
		} {
			if(S[i + 1].equals(S[i])){
				count++;
				if(i == N - 2){
					map.put(S[i],count);
					max = Math.max(max,count);
				}
			}else{
				map.put(S[i],count);
				max = Math.max(max,count);
				count = 1;
				if(i == N - 2){
					map.put(S[i + 1],count);
					max = Math.max(max,count);
				}
			}
		} if(S[i + 1].equals(S[i])){
				count++;
				if(i == N - 2){
					map.put(S[i],count);
					max = Math.max(max,count);
				}
			}else{
				map.put(S[i],count);
				max = Math.max(max,count);
				count = 1;
				if(i == N - 2){
					map.put(S[i + 1],count);
					max = Math.max(max,count);
				}
			} S[i + 1].equals(S[i]) S[i + 1].equals S[i + 1] S i + 1 i 1 S[i] S i {
				count++;
				if(i == N - 2){
					map.put(S[i],count);
					max = Math.max(max,count);
				}
			} count++ count if(i == N - 2){
					map.put(S[i],count);
					max = Math.max(max,count);
				} i == N - 2 i N - 2 N 2 {
					map.put(S[i],count);
					max = Math.max(max,count);
				} map.put(S[i],count) map.put map S[i] S i count max = Math.max(max,count) max Math.max(max,count) Math.max Math max count {
				map.put(S[i],count);
				max = Math.max(max,count);
				count = 1;
				if(i == N - 2){
					map.put(S[i + 1],count);
					max = Math.max(max,count);
				}
			} map.put(S[i],count) map.put map S[i] S i count max = Math.max(max,count) max Math.max(max,count) Math.max Math max count count = 1 count 1 if(i == N - 2){
					map.put(S[i + 1],count);
					max = Math.max(max,count);
				} i == N - 2 i N - 2 N 2 {
					map.put(S[i + 1],count);
					max = Math.max(max,count);
				} map.put(S[i + 1],count) map.put map S[i + 1] S i + 1 i 1 count max = Math.max(max,count) max Math.max(max,count) Math.max Math max count for(String key : map.keySet()){
			if(map.get(key) == max){
				System.out.println(key);
			}
		} String key map.keySet() map.keySet map {
			if(map.get(key) == max){
				System.out.println(key);
			}
		} {
			if(map.get(key) == max){
				System.out.println(key);
			}
		} if(map.get(key) == max){
				System.out.println(key);
			} map.get(key) == max map.get(key) map.get map key max {
				System.out.println(key);
			} 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();
		int count = 1;
		int max = 0;
		String[] S = new String[N];
		for(int i = 0;i < N;i++){
			S[i] = sc.next();
		}
		Arrays.sort(S);
		Map<String,Integer> map = new TreeMap<>();
		for(int i = 0;i < N - 1;i++){
			if(S[i + 1].equals(S[i])){
				count++;
				if(i == N - 2){
					map.put(S[i],count);
					max = Math.max(max,count);
				}
			}else{
				map.put(S[i],count);
				max = Math.max(max,count);
				count = 1;
				if(i == N - 2){
					map.put(S[i + 1],count);
					max = Math.max(max,count);
				}
			}
		}
		for(String key : map.keySet()){
			if(map.get(key) == max){
				System.out.println(key);
			}
		}
	}
} public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 1;
		int max = 0;
		String[] S = new String[N];
		for(int i = 0;i < N;i++){
			S[i] = sc.next();
		}
		Arrays.sort(S);
		Map<String,Integer> map = new TreeMap<>();
		for(int i = 0;i < N - 1;i++){
			if(S[i + 1].equals(S[i])){
				count++;
				if(i == N - 2){
					map.put(S[i],count);
					max = Math.max(max,count);
				}
			}else{
				map.put(S[i],count);
				max = Math.max(max,count);
				count = 1;
				if(i == N - 2){
					map.put(S[i + 1],count);
					max = Math.max(max,count);
				}
			}
		}
		for(String key : map.keySet()){
			if(map.get(key) == max){
				System.out.println(key);
			}
		}
	}
} Main
import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 1;
		int max = 0;
		String[] S = new String[N];
		for(int i = 0;i < N;i++){
			S[i] = sc.next();
		}
		Arrays.sort(S);
		Map<String,Integer> map = new TreeMap<>();
		for(int i = 0;i < N - 1;i++){
			if(S[i + 1].equals(S[i])){
				count++;
				if(i == N - 2){
					map.put(S[i],count);
					max = Math.max(max,count);
				}
			}else{
				map.put(S[i],count);
				max = Math.max(max,count);
				count = 1;
				if(i == N - 2){
					map.put(S[i + 1],count);
					max = Math.max(max,count);
				}
			}
		}
		for(String key : map.keySet()){
			if(map.get(key) == max){
				System.out.println(key);
			}
		}
	}
}