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();
		int[] a= new int[n];
		String[] s=new String[n];
		int count=0,max=0;;

		for(int i=0;i<n;i++) {
			s[i]=sc.next();
		}
		Arrays.parallelSort(s);
		for(int i=0;i<n-1;i++) {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				max=Math.max(count, max);
				count=0;
			}
		}
		if(count!=0) {
			count++;
			max=Math.max(count, max);
		}
		count=0;
		for(int i=0;i<n-1;i++) {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				if(count==max) {
					System.out.println(s[i]);
				}
				count=0;
			}
		}
		if(count!=0)count++;
		if(count==max) {
			System.out.println(s[n-1]);
		}
		/*for(String buff:s) {
			System.out.println(buff);
		}
		System.out.println(max+" "+count);*/
	}
}
 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();
		int[] a= new int[n];
		String[] s=new String[n];
		int count=0,max=0;;

		for(int i=0;i<n;i++) {
			s[i]=sc.next();
		}
		Arrays.parallelSort(s);
		for(int i=0;i<n-1;i++) {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				max=Math.max(count, max);
				count=0;
			}
		}
		if(count!=0) {
			count++;
			max=Math.max(count, max);
		}
		count=0;
		for(int i=0;i<n-1;i++) {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				if(count==max) {
					System.out.println(s[i]);
				}
				count=0;
			}
		}
		if(count!=0)count++;
		if(count==max) {
			System.out.println(s[n-1]);
		}
		/*for(String buff:s) {
			System.out.println(buff);
		}
		System.out.println(max+" "+count);*/
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a= new int[n];
		String[] s=new String[n];
		int count=0,max=0;;

		for(int i=0;i<n;i++) {
			s[i]=sc.next();
		}
		Arrays.parallelSort(s);
		for(int i=0;i<n-1;i++) {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				max=Math.max(count, max);
				count=0;
			}
		}
		if(count!=0) {
			count++;
			max=Math.max(count, max);
		}
		count=0;
		for(int i=0;i<n-1;i++) {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				if(count==max) {
					System.out.println(s[i]);
				}
				count=0;
			}
		}
		if(count!=0)count++;
		if(count==max) {
			System.out.println(s[n-1]);
		}
		/*for(String buff:s) {
			System.out.println(buff);
		}
		System.out.println(max+" "+count);*/
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a= new int[n];
		String[] s=new String[n];
		int count=0,max=0;;

		for(int i=0;i<n;i++) {
			s[i]=sc.next();
		}
		Arrays.parallelSort(s);
		for(int i=0;i<n-1;i++) {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				max=Math.max(count, max);
				count=0;
			}
		}
		if(count!=0) {
			count++;
			max=Math.max(count, max);
		}
		count=0;
		for(int i=0;i<n-1;i++) {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				if(count==max) {
					System.out.println(s[i]);
				}
				count=0;
			}
		}
		if(count!=0)count++;
		if(count==max) {
			System.out.println(s[n-1]);
		}
		/*for(String buff:s) {
			System.out.println(buff);
		}
		System.out.println(max+" "+count);*/
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] a= new int[n]; a new int[n] n String[] s=new String[n]; s new String[n] n int count=0 count 0 max=0; max 0 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.parallelSort(s) Arrays.parallelSort Arrays s for(int i=0;i<n-1;i++) {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				max=Math.max(count, max);
				count=0;
			}
		} int i=0; int i=0; i 0 i<n-1 i n-1 n 1 i++ i++ i {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				max=Math.max(count, max);
				count=0;
			}
		} {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				max=Math.max(count, max);
				count=0;
			}
		} if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				max=Math.max(count, max);
				count=0;
			} s[i].equals(s[i+1]) s[i].equals s[i] s i s[i+1] s i+1 i 1 {
				count++;
			} count++ count {
				if(count!=0)count++;
				max=Math.max(count, max);
				count=0;
			} if(count!=0)count++; count!=0 count 0 count++ count max=Math.max(count, max) max Math.max(count, max) Math.max Math count max count=0 count 0 if(count!=0) {
			count++;
			max=Math.max(count, max);
		} count!=0 count 0 {
			count++;
			max=Math.max(count, max);
		} count++ count max=Math.max(count, max) max Math.max(count, max) Math.max Math count max count=0 count 0 for(int i=0;i<n-1;i++) {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				if(count==max) {
					System.out.println(s[i]);
				}
				count=0;
			}
		} int i=0; int i=0; i 0 i<n-1 i n-1 n 1 i++ i++ i {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				if(count==max) {
					System.out.println(s[i]);
				}
				count=0;
			}
		} {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				if(count==max) {
					System.out.println(s[i]);
				}
				count=0;
			}
		} if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				if(count==max) {
					System.out.println(s[i]);
				}
				count=0;
			} s[i].equals(s[i+1]) s[i].equals s[i] s i s[i+1] s i+1 i 1 {
				count++;
			} count++ count {
				if(count!=0)count++;
				if(count==max) {
					System.out.println(s[i]);
				}
				count=0;
			} if(count!=0)count++; count!=0 count 0 count++ count if(count==max) {
					System.out.println(s[i]);
				} count==max count max {
					System.out.println(s[i]);
				} System.out.println(s[i]) System.out.println System.out System System.out s[i] s i count=0 count 0 if(count!=0)count++; count!=0 count 0 count++ count if(count==max) {
			System.out.println(s[n-1]);
		} count==max count max {
			System.out.println(s[n-1]);
		} System.out.println(s[n-1]) System.out.println System.out System System.out s[n-1] s n-1 n 1 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a= new int[n];
		String[] s=new String[n];
		int count=0,max=0;;

		for(int i=0;i<n;i++) {
			s[i]=sc.next();
		}
		Arrays.parallelSort(s);
		for(int i=0;i<n-1;i++) {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				max=Math.max(count, max);
				count=0;
			}
		}
		if(count!=0) {
			count++;
			max=Math.max(count, max);
		}
		count=0;
		for(int i=0;i<n-1;i++) {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				if(count==max) {
					System.out.println(s[i]);
				}
				count=0;
			}
		}
		if(count!=0)count++;
		if(count==max) {
			System.out.println(s[n-1]);
		}
		/*for(String buff:s) {
			System.out.println(buff);
		}
		System.out.println(max+" "+count);*/
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a= new int[n];
		String[] s=new String[n];
		int count=0,max=0;;

		for(int i=0;i<n;i++) {
			s[i]=sc.next();
		}
		Arrays.parallelSort(s);
		for(int i=0;i<n-1;i++) {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				max=Math.max(count, max);
				count=0;
			}
		}
		if(count!=0) {
			count++;
			max=Math.max(count, max);
		}
		count=0;
		for(int i=0;i<n-1;i++) {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				if(count==max) {
					System.out.println(s[i]);
				}
				count=0;
			}
		}
		if(count!=0)count++;
		if(count==max) {
			System.out.println(s[n-1]);
		}
		/*for(String buff:s) {
			System.out.println(buff);
		}
		System.out.println(max+" "+count);*/
	}
} 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();
		int[] a= new int[n];
		String[] s=new String[n];
		int count=0,max=0;;

		for(int i=0;i<n;i++) {
			s[i]=sc.next();
		}
		Arrays.parallelSort(s);
		for(int i=0;i<n-1;i++) {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				max=Math.max(count, max);
				count=0;
			}
		}
		if(count!=0) {
			count++;
			max=Math.max(count, max);
		}
		count=0;
		for(int i=0;i<n-1;i++) {
			if(s[i].equals(s[i+1])) {
				count++;
			}else {
				if(count!=0)count++;
				if(count==max) {
					System.out.println(s[i]);
				}
				count=0;
			}
		}
		if(count!=0)count++;
		if(count==max) {
			System.out.println(s[n-1]);
		}
		/*for(String buff:s) {
			System.out.println(buff);
		}
		System.out.println(max+" "+count);*/
	}
}

