import java.util.ArrayList;
import java.util.Arrays;
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();
		String[] array = new String[n];
		for(int i= 0; i < n;i++) {
			array[i] = sc.next();
		}
		Arrays.sort(array);
		List<String> answerList = new ArrayList<String>();
		int count = 1;
		int maxCount = 1;
		for(int i = 1;i < n;i++) {
			if(array[i-1].equals(array[i])) {
				count++;
			}else {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i-1]);
					maxCount = count;
					count = 1;
				}else if(count== maxCount) {
					answerList.add(array[i-1]);
					count = 1;
				}else {
					count = 1;
				}
			}
			if(i == n-1) {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i]);
				}else if(count== maxCount) {
					answerList.add(array[i]);
				}
			}
		}


		for(String answer :answerList) {
			System.out.println(answer);
		}
	}

} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays 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();
		String[] array = new String[n];
		for(int i= 0; i < n;i++) {
			array[i] = sc.next();
		}
		Arrays.sort(array);
		List<String> answerList = new ArrayList<String>();
		int count = 1;
		int maxCount = 1;
		for(int i = 1;i < n;i++) {
			if(array[i-1].equals(array[i])) {
				count++;
			}else {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i-1]);
					maxCount = count;
					count = 1;
				}else if(count== maxCount) {
					answerList.add(array[i-1]);
					count = 1;
				}else {
					count = 1;
				}
			}
			if(i == n-1) {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i]);
				}else if(count== maxCount) {
					answerList.add(array[i]);
				}
			}
		}


		for(String answer :answerList) {
			System.out.println(answer);
		}
	}

} Main public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] array = new String[n];
		for(int i= 0; i < n;i++) {
			array[i] = sc.next();
		}
		Arrays.sort(array);
		List<String> answerList = new ArrayList<String>();
		int count = 1;
		int maxCount = 1;
		for(int i = 1;i < n;i++) {
			if(array[i-1].equals(array[i])) {
				count++;
			}else {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i-1]);
					maxCount = count;
					count = 1;
				}else if(count== maxCount) {
					answerList.add(array[i-1]);
					count = 1;
				}else {
					count = 1;
				}
			}
			if(i == n-1) {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i]);
				}else if(count== maxCount) {
					answerList.add(array[i]);
				}
			}
		}


		for(String answer :answerList) {
			System.out.println(answer);
		}
	} main {


		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] array = new String[n];
		for(int i= 0; i < n;i++) {
			array[i] = sc.next();
		}
		Arrays.sort(array);
		List<String> answerList = new ArrayList<String>();
		int count = 1;
		int maxCount = 1;
		for(int i = 1;i < n;i++) {
			if(array[i-1].equals(array[i])) {
				count++;
			}else {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i-1]);
					maxCount = count;
					count = 1;
				}else if(count== maxCount) {
					answerList.add(array[i-1]);
					count = 1;
				}else {
					count = 1;
				}
			}
			if(i == n-1) {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i]);
				}else if(count== maxCount) {
					answerList.add(array[i]);
				}
			}
		}


		for(String answer :answerList) {
			System.out.println(answer);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String[] array = new String[n]; array new String[n] n for(int i= 0; i < n;i++) {
			array[i] = sc.next();
		} int i= 0; int i= 0; i 0 i < n i n i++ i++ i {
			array[i] = sc.next();
		} {
			array[i] = sc.next();
		} array[i] = sc.next() array[i] array i sc.next() sc.next sc Arrays.sort(array) Arrays.sort Arrays array List<String> answerList = new ArrayList<String>(); answerList new ArrayList<String>() int count = 1; count 1 int maxCount = 1; maxCount 1 for(int i = 1;i < n;i++) {
			if(array[i-1].equals(array[i])) {
				count++;
			}else {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i-1]);
					maxCount = count;
					count = 1;
				}else if(count== maxCount) {
					answerList.add(array[i-1]);
					count = 1;
				}else {
					count = 1;
				}
			}
			if(i == n-1) {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i]);
				}else if(count== maxCount) {
					answerList.add(array[i]);
				}
			}
		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
			if(array[i-1].equals(array[i])) {
				count++;
			}else {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i-1]);
					maxCount = count;
					count = 1;
				}else if(count== maxCount) {
					answerList.add(array[i-1]);
					count = 1;
				}else {
					count = 1;
				}
			}
			if(i == n-1) {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i]);
				}else if(count== maxCount) {
					answerList.add(array[i]);
				}
			}
		} {
			if(array[i-1].equals(array[i])) {
				count++;
			}else {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i-1]);
					maxCount = count;
					count = 1;
				}else if(count== maxCount) {
					answerList.add(array[i-1]);
					count = 1;
				}else {
					count = 1;
				}
			}
			if(i == n-1) {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i]);
				}else if(count== maxCount) {
					answerList.add(array[i]);
				}
			}
		} if(array[i-1].equals(array[i])) {
				count++;
			}else {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i-1]);
					maxCount = count;
					count = 1;
				}else if(count== maxCount) {
					answerList.add(array[i-1]);
					count = 1;
				}else {
					count = 1;
				}
			} array[i-1].equals(array[i]) array[i-1].equals array[i-1] array i-1 i 1 array[i] array i {
				count++;
			} count++ count {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i-1]);
					maxCount = count;
					count = 1;
				}else if(count== maxCount) {
					answerList.add(array[i-1]);
					count = 1;
				}else {
					count = 1;
				}
			} if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i-1]);
					maxCount = count;
					count = 1;
				}else if(count== maxCount) {
					answerList.add(array[i-1]);
					count = 1;
				}else {
					count = 1;
				} count> maxCount count maxCount {
					answerList.clear();
					answerList.add(array[i-1]);
					maxCount = count;
					count = 1;
				} answerList.clear() answerList.clear answerList answerList.add(array[i-1]) answerList.add answerList array[i-1] array i-1 i 1 maxCount = count maxCount count count = 1 count 1 if(count== maxCount) {
					answerList.add(array[i-1]);
					count = 1;
				}else {
					count = 1;
				} count== maxCount count maxCount {
					answerList.add(array[i-1]);
					count = 1;
				} answerList.add(array[i-1]) answerList.add answerList array[i-1] array i-1 i 1 count = 1 count 1 {
					count = 1;
				} count = 1 count 1 if(i == n-1) {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i]);
				}else if(count== maxCount) {
					answerList.add(array[i]);
				}
			} i == n-1 i n-1 n 1 {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i]);
				}else if(count== maxCount) {
					answerList.add(array[i]);
				}
			} if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i]);
				}else if(count== maxCount) {
					answerList.add(array[i]);
				} count> maxCount count maxCount {
					answerList.clear();
					answerList.add(array[i]);
				} answerList.clear() answerList.clear answerList answerList.add(array[i]) answerList.add answerList array[i] array i if(count== maxCount) {
					answerList.add(array[i]);
				} count== maxCount count maxCount {
					answerList.add(array[i]);
				} answerList.add(array[i]) answerList.add answerList array[i] array i for(String answer :answerList) {
			System.out.println(answer);
		} String answer answerList {
			System.out.println(answer);
		} {
			System.out.println(answer);
		} System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] array = new String[n];
		for(int i= 0; i < n;i++) {
			array[i] = sc.next();
		}
		Arrays.sort(array);
		List<String> answerList = new ArrayList<String>();
		int count = 1;
		int maxCount = 1;
		for(int i = 1;i < n;i++) {
			if(array[i-1].equals(array[i])) {
				count++;
			}else {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i-1]);
					maxCount = count;
					count = 1;
				}else if(count== maxCount) {
					answerList.add(array[i-1]);
					count = 1;
				}else {
					count = 1;
				}
			}
			if(i == n-1) {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i]);
				}else if(count== maxCount) {
					answerList.add(array[i]);
				}
			}
		}


		for(String answer :answerList) {
			System.out.println(answer);
		}
	}

} public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] array = new String[n];
		for(int i= 0; i < n;i++) {
			array[i] = sc.next();
		}
		Arrays.sort(array);
		List<String> answerList = new ArrayList<String>();
		int count = 1;
		int maxCount = 1;
		for(int i = 1;i < n;i++) {
			if(array[i-1].equals(array[i])) {
				count++;
			}else {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i-1]);
					maxCount = count;
					count = 1;
				}else if(count== maxCount) {
					answerList.add(array[i-1]);
					count = 1;
				}else {
					count = 1;
				}
			}
			if(i == n-1) {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i]);
				}else if(count== maxCount) {
					answerList.add(array[i]);
				}
			}
		}


		for(String answer :answerList) {
			System.out.println(answer);
		}
	}

} Main
import java.util.ArrayList;
import java.util.Arrays;
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();
		String[] array = new String[n];
		for(int i= 0; i < n;i++) {
			array[i] = sc.next();
		}
		Arrays.sort(array);
		List<String> answerList = new ArrayList<String>();
		int count = 1;
		int maxCount = 1;
		for(int i = 1;i < n;i++) {
			if(array[i-1].equals(array[i])) {
				count++;
			}else {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i-1]);
					maxCount = count;
					count = 1;
				}else if(count== maxCount) {
					answerList.add(array[i-1]);
					count = 1;
				}else {
					count = 1;
				}
			}
			if(i == n-1) {
				if(count> maxCount) {
					answerList.clear();
					answerList.add(array[i]);
				}else if(count== maxCount) {
					answerList.add(array[i]);
				}
			}
		}


		for(String answer :answerList) {
			System.out.println(answer);
		}
	}

}