
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] ary = new String[n];
		for(int i = 0; i < n; i++){
			ary[i] = sc.next();
		}
		Arrays.sort(ary);
		int[] streakAry = new int[n];
		int maxNum = 0;
		int sameNum = 0;
		String before = ary[0];
		streakAry[0] = 0;
		for(int i = 1; i < n; i++){
			if(before.equals(ary[i])){
				sameNum++;
				maxNum = Math.max(maxNum, sameNum);
			}else{
				sameNum = 0;
			}
			before = ary[i];
			streakAry[i] = sameNum;
		}
		for(int i = 0; i < n; i++){
			if(streakAry[i] == maxNum){
				System.out.println(ary[i]);
			}
		}
	}
} import java.util.Arrays; Arrays 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[] ary = new String[n];
		for(int i = 0; i < n; i++){
			ary[i] = sc.next();
		}
		Arrays.sort(ary);
		int[] streakAry = new int[n];
		int maxNum = 0;
		int sameNum = 0;
		String before = ary[0];
		streakAry[0] = 0;
		for(int i = 1; i < n; i++){
			if(before.equals(ary[i])){
				sameNum++;
				maxNum = Math.max(maxNum, sameNum);
			}else{
				sameNum = 0;
			}
			before = ary[i];
			streakAry[i] = sameNum;
		}
		for(int i = 0; i < n; i++){
			if(streakAry[i] == maxNum){
				System.out.println(ary[i]);
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] ary = new String[n];
		for(int i = 0; i < n; i++){
			ary[i] = sc.next();
		}
		Arrays.sort(ary);
		int[] streakAry = new int[n];
		int maxNum = 0;
		int sameNum = 0;
		String before = ary[0];
		streakAry[0] = 0;
		for(int i = 1; i < n; i++){
			if(before.equals(ary[i])){
				sameNum++;
				maxNum = Math.max(maxNum, sameNum);
			}else{
				sameNum = 0;
			}
			before = ary[i];
			streakAry[i] = sameNum;
		}
		for(int i = 0; i < n; i++){
			if(streakAry[i] == maxNum){
				System.out.println(ary[i]);
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] ary = new String[n];
		for(int i = 0; i < n; i++){
			ary[i] = sc.next();
		}
		Arrays.sort(ary);
		int[] streakAry = new int[n];
		int maxNum = 0;
		int sameNum = 0;
		String before = ary[0];
		streakAry[0] = 0;
		for(int i = 1; i < n; i++){
			if(before.equals(ary[i])){
				sameNum++;
				maxNum = Math.max(maxNum, sameNum);
			}else{
				sameNum = 0;
			}
			before = ary[i];
			streakAry[i] = sameNum;
		}
		for(int i = 0; i < n; i++){
			if(streakAry[i] == maxNum){
				System.out.println(ary[i]);
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String[] ary = new String[n]; ary new String[n] n for(int i = 0; i < n; i++){
			ary[i] = sc.next();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			ary[i] = sc.next();
		} {
			ary[i] = sc.next();
		} ary[i] = sc.next() ary[i] ary i sc.next() sc.next sc Arrays.sort(ary) Arrays.sort Arrays ary int[] streakAry = new int[n]; streakAry new int[n] n int maxNum = 0; maxNum 0 int sameNum = 0; sameNum 0 String before = ary[0]; before ary[0] ary 0 streakAry[0] = 0 streakAry[0] streakAry 0 0 for(int i = 1; i < n; i++){
			if(before.equals(ary[i])){
				sameNum++;
				maxNum = Math.max(maxNum, sameNum);
			}else{
				sameNum = 0;
			}
			before = ary[i];
			streakAry[i] = sameNum;
		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
			if(before.equals(ary[i])){
				sameNum++;
				maxNum = Math.max(maxNum, sameNum);
			}else{
				sameNum = 0;
			}
			before = ary[i];
			streakAry[i] = sameNum;
		} {
			if(before.equals(ary[i])){
				sameNum++;
				maxNum = Math.max(maxNum, sameNum);
			}else{
				sameNum = 0;
			}
			before = ary[i];
			streakAry[i] = sameNum;
		} if(before.equals(ary[i])){
				sameNum++;
				maxNum = Math.max(maxNum, sameNum);
			}else{
				sameNum = 0;
			} before.equals(ary[i]) before.equals before ary[i] ary i {
				sameNum++;
				maxNum = Math.max(maxNum, sameNum);
			} sameNum++ sameNum maxNum = Math.max(maxNum, sameNum) maxNum Math.max(maxNum, sameNum) Math.max Math maxNum sameNum {
				sameNum = 0;
			} sameNum = 0 sameNum 0 before = ary[i] before ary[i] ary i streakAry[i] = sameNum streakAry[i] streakAry i sameNum for(int i = 0; i < n; i++){
			if(streakAry[i] == maxNum){
				System.out.println(ary[i]);
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if(streakAry[i] == maxNum){
				System.out.println(ary[i]);
			}
		} {
			if(streakAry[i] == maxNum){
				System.out.println(ary[i]);
			}
		} if(streakAry[i] == maxNum){
				System.out.println(ary[i]);
			} streakAry[i] == maxNum streakAry[i] streakAry i maxNum {
				System.out.println(ary[i]);
			} System.out.println(ary[i]) System.out.println System.out System System.out ary[i] ary i String[] args args public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] ary = new String[n];
		for(int i = 0; i < n; i++){
			ary[i] = sc.next();
		}
		Arrays.sort(ary);
		int[] streakAry = new int[n];
		int maxNum = 0;
		int sameNum = 0;
		String before = ary[0];
		streakAry[0] = 0;
		for(int i = 1; i < n; i++){
			if(before.equals(ary[i])){
				sameNum++;
				maxNum = Math.max(maxNum, sameNum);
			}else{
				sameNum = 0;
			}
			before = ary[i];
			streakAry[i] = sameNum;
		}
		for(int i = 0; i < n; i++){
			if(streakAry[i] == maxNum){
				System.out.println(ary[i]);
			}
		}
	}
} public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] ary = new String[n];
		for(int i = 0; i < n; i++){
			ary[i] = sc.next();
		}
		Arrays.sort(ary);
		int[] streakAry = new int[n];
		int maxNum = 0;
		int sameNum = 0;
		String before = ary[0];
		streakAry[0] = 0;
		for(int i = 1; i < n; i++){
			if(before.equals(ary[i])){
				sameNum++;
				maxNum = Math.max(maxNum, sameNum);
			}else{
				sameNum = 0;
			}
			before = ary[i];
			streakAry[i] = sameNum;
		}
		for(int i = 0; i < n; i++){
			if(streakAry[i] == maxNum){
				System.out.println(ary[i]);
			}
		}
	}
} Main

import java.util.Arrays;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] ary = new String[n];
		for(int i = 0; i < n; i++){
			ary[i] = sc.next();
		}
		Arrays.sort(ary);
		int[] streakAry = new int[n];
		int maxNum = 0;
		int sameNum = 0;
		String before = ary[0];
		streakAry[0] = 0;
		for(int i = 1; i < n; i++){
			if(before.equals(ary[i])){
				sameNum++;
				maxNum = Math.max(maxNum, sameNum);
			}else{
				sameNum = 0;
			}
			before = ary[i];
			streakAry[i] = sameNum;
		}
		for(int i = 0; i < n; i++){
			if(streakAry[i] == maxNum){
				System.out.println(ary[i]);
			}
		}
	}
}
