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[] array = new String[n];
		int[] iarray = new int[n];
		sc.nextLine();
		for(int i = 0;i < n;i++){
			array[i] = sc.nextLine();
		}
		Arrays.sort(array);
int count = 0;
int max = 0;
		for(int i = 0;i < n-1;i++){
			if(array[i].equals(array[i+1])){
				count++;
				iarray[i] = count;
				if(i == n-2 && max < count){
					max = count;
				}
			}else{
				if(max < count){
					max = count;
				}
				count = 0;
				iarray[i] = count;
			}
		}

		for(int i = 0;i < n;i++){
			if(iarray[i] == max){
				System.out.println(array[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[] array = new String[n];
		int[] iarray = new int[n];
		sc.nextLine();
		for(int i = 0;i < n;i++){
			array[i] = sc.nextLine();
		}
		Arrays.sort(array);
int count = 0;
int max = 0;
		for(int i = 0;i < n-1;i++){
			if(array[i].equals(array[i+1])){
				count++;
				iarray[i] = count;
				if(i == n-2 && max < count){
					max = count;
				}
			}else{
				if(max < count){
					max = count;
				}
				count = 0;
				iarray[i] = count;
			}
		}

		for(int i = 0;i < n;i++){
			if(iarray[i] == max){
				System.out.println(array[i]);
			}
		}

		}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] array = new String[n];
		int[] iarray = new int[n];
		sc.nextLine();
		for(int i = 0;i < n;i++){
			array[i] = sc.nextLine();
		}
		Arrays.sort(array);
int count = 0;
int max = 0;
		for(int i = 0;i < n-1;i++){
			if(array[i].equals(array[i+1])){
				count++;
				iarray[i] = count;
				if(i == n-2 && max < count){
					max = count;
				}
			}else{
				if(max < count){
					max = count;
				}
				count = 0;
				iarray[i] = count;
			}
		}

		for(int i = 0;i < n;i++){
			if(iarray[i] == max){
				System.out.println(array[i]);
			}
		}

		} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] array = new String[n];
		int[] iarray = new int[n];
		sc.nextLine();
		for(int i = 0;i < n;i++){
			array[i] = sc.nextLine();
		}
		Arrays.sort(array);
int count = 0;
int max = 0;
		for(int i = 0;i < n-1;i++){
			if(array[i].equals(array[i+1])){
				count++;
				iarray[i] = count;
				if(i == n-2 && max < count){
					max = count;
				}
			}else{
				if(max < count){
					max = count;
				}
				count = 0;
				iarray[i] = count;
			}
		}

		for(int i = 0;i < n;i++){
			if(iarray[i] == max){
				System.out.println(array[i]);
			}
		}

		} 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 int[] iarray = new int[n]; iarray new int[n] n sc.nextLine() sc.nextLine sc for(int i = 0;i < n;i++){
			array[i] = sc.nextLine();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			array[i] = sc.nextLine();
		} {
			array[i] = sc.nextLine();
		} array[i] = sc.nextLine() array[i] array i sc.nextLine() sc.nextLine sc Arrays.sort(array) Arrays.sort Arrays array int count = 0; count 0 int max = 0; max 0 for(int i = 0;i < n-1;i++){
			if(array[i].equals(array[i+1])){
				count++;
				iarray[i] = count;
				if(i == n-2 && max < count){
					max = count;
				}
			}else{
				if(max < count){
					max = count;
				}
				count = 0;
				iarray[i] = count;
			}
		} int i = 0; int i = 0; i 0 i < n-1 i n-1 n 1 i++ i++ i {
			if(array[i].equals(array[i+1])){
				count++;
				iarray[i] = count;
				if(i == n-2 && max < count){
					max = count;
				}
			}else{
				if(max < count){
					max = count;
				}
				count = 0;
				iarray[i] = count;
			}
		} {
			if(array[i].equals(array[i+1])){
				count++;
				iarray[i] = count;
				if(i == n-2 && max < count){
					max = count;
				}
			}else{
				if(max < count){
					max = count;
				}
				count = 0;
				iarray[i] = count;
			}
		} if(array[i].equals(array[i+1])){
				count++;
				iarray[i] = count;
				if(i == n-2 && max < count){
					max = count;
				}
			}else{
				if(max < count){
					max = count;
				}
				count = 0;
				iarray[i] = count;
			} array[i].equals(array[i+1]) array[i].equals array[i] array i array[i+1] array i+1 i 1 {
				count++;
				iarray[i] = count;
				if(i == n-2 && max < count){
					max = count;
				}
			} count++ count iarray[i] = count iarray[i] iarray i count if(i == n-2 && max < count){
					max = count;
				} i == n-2 && max < count i == n-2 i n-2 n 2 max < count max count {
					max = count;
				} max = count max count {
				if(max < count){
					max = count;
				}
				count = 0;
				iarray[i] = count;
			} if(max < count){
					max = count;
				} max < count max count {
					max = count;
				} max = count max count count = 0 count 0 iarray[i] = count iarray[i] iarray i count for(int i = 0;i < n;i++){
			if(iarray[i] == max){
				System.out.println(array[i]);
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if(iarray[i] == max){
				System.out.println(array[i]);
			}
		} {
			if(iarray[i] == max){
				System.out.println(array[i]);
			}
		} if(iarray[i] == max){
				System.out.println(array[i]);
			} iarray[i] == max iarray[i] iarray i max {
				System.out.println(array[i]);
			} System.out.println(array[i]) System.out.println System.out System System.out array[i] array i 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];
		int[] iarray = new int[n];
		sc.nextLine();
		for(int i = 0;i < n;i++){
			array[i] = sc.nextLine();
		}
		Arrays.sort(array);
int count = 0;
int max = 0;
		for(int i = 0;i < n-1;i++){
			if(array[i].equals(array[i+1])){
				count++;
				iarray[i] = count;
				if(i == n-2 && max < count){
					max = count;
				}
			}else{
				if(max < count){
					max = count;
				}
				count = 0;
				iarray[i] = count;
			}
		}

		for(int i = 0;i < n;i++){
			if(iarray[i] == max){
				System.out.println(array[i]);
			}
		}

		}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] array = new String[n];
		int[] iarray = new int[n];
		sc.nextLine();
		for(int i = 0;i < n;i++){
			array[i] = sc.nextLine();
		}
		Arrays.sort(array);
int count = 0;
int max = 0;
		for(int i = 0;i < n-1;i++){
			if(array[i].equals(array[i+1])){
				count++;
				iarray[i] = count;
				if(i == n-2 && max < count){
					max = count;
				}
			}else{
				if(max < count){
					max = count;
				}
				count = 0;
				iarray[i] = count;
			}
		}

		for(int i = 0;i < n;i++){
			if(iarray[i] == max){
				System.out.println(array[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[] array = new String[n];
		int[] iarray = new int[n];
		sc.nextLine();
		for(int i = 0;i < n;i++){
			array[i] = sc.nextLine();
		}
		Arrays.sort(array);
int count = 0;
int max = 0;
		for(int i = 0;i < n-1;i++){
			if(array[i].equals(array[i+1])){
				count++;
				iarray[i] = count;
				if(i == n-2 && max < count){
					max = count;
				}
			}else{
				if(max < count){
					max = count;
				}
				count = 0;
				iarray[i] = count;
			}
		}

		for(int i = 0;i < n;i++){
			if(iarray[i] == max){
				System.out.println(array[i]);
			}
		}

		}
}