import java.util.*;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		String s[] = new String[n];
		int data[] = new int [n];
		int count = 0;
		int max = 0;
		String ans[] = new String[n];
		int precount = 0;

		for (int i = 0;i<n ;i++ ) {
			s[i] = sc.next();
			ans[i] = s[i];
		}

		Arrays.sort(s);
		Arrays.sort(ans);

		for (int i = 0;i<n-1 ;i++ ) {
			if (s[i].equals(s[i+1])) {
				data[count]++;
				ans[count] = s[i];
				precount++;
			}else{
				max = Math.max(max,data[count]);
				count++;
			}
		}
		max = Math.max(max,data[count]);
		if (n-1==precount) {
			System.out.println(ans[0]);
			System.exit(0);
		}

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




	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		String s[] = new String[n];
		int data[] = new int [n];
		int count = 0;
		int max = 0;
		String ans[] = new String[n];
		int precount = 0;

		for (int i = 0;i<n ;i++ ) {
			s[i] = sc.next();
			ans[i] = s[i];
		}

		Arrays.sort(s);
		Arrays.sort(ans);

		for (int i = 0;i<n-1 ;i++ ) {
			if (s[i].equals(s[i+1])) {
				data[count]++;
				ans[count] = s[i];
				precount++;
			}else{
				max = Math.max(max,data[count]);
				count++;
			}
		}
		max = Math.max(max,data[count]);
		if (n-1==precount) {
			System.out.println(ans[0]);
			System.exit(0);
		}

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




	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		String s[] = new String[n];
		int data[] = new int [n];
		int count = 0;
		int max = 0;
		String ans[] = new String[n];
		int precount = 0;

		for (int i = 0;i<n ;i++ ) {
			s[i] = sc.next();
			ans[i] = s[i];
		}

		Arrays.sort(s);
		Arrays.sort(ans);

		for (int i = 0;i<n-1 ;i++ ) {
			if (s[i].equals(s[i+1])) {
				data[count]++;
				ans[count] = s[i];
				precount++;
			}else{
				max = Math.max(max,data[count]);
				count++;
			}
		}
		max = Math.max(max,data[count]);
		if (n-1==precount) {
			System.out.println(ans[0]);
			System.exit(0);
		}

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




	} main {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		String s[] = new String[n];
		int data[] = new int [n];
		int count = 0;
		int max = 0;
		String ans[] = new String[n];
		int precount = 0;

		for (int i = 0;i<n ;i++ ) {
			s[i] = sc.next();
			ans[i] = s[i];
		}

		Arrays.sort(s);
		Arrays.sort(ans);

		for (int i = 0;i<n-1 ;i++ ) {
			if (s[i].equals(s[i+1])) {
				data[count]++;
				ans[count] = s[i];
				precount++;
			}else{
				max = Math.max(max,data[count]);
				count++;
			}
		}
		max = Math.max(max,data[count]);
		if (n-1==precount) {
			System.out.println(ans[0]);
			System.exit(0);
		}

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




	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String s[] = new String[n]; s new String[n] n int data[] = new int [n]; data new int [n] n int count = 0; count 0 int max = 0; max 0 String ans[] = new String[n]; ans new String[n] n int precount = 0; precount 0 for (int i = 0;i<n ;i++ ) {
			s[i] = sc.next();
			ans[i] = s[i];
		} int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
			s[i] = sc.next();
			ans[i] = s[i];
		} {
			s[i] = sc.next();
			ans[i] = s[i];
		} s[i] = sc.next() s[i] s i sc.next() sc.next sc ans[i] = s[i] ans[i] ans i s[i] s i Arrays.sort(s) Arrays.sort Arrays s Arrays.sort(ans) Arrays.sort Arrays ans for (int i = 0;i<n-1 ;i++ ) {
			if (s[i].equals(s[i+1])) {
				data[count]++;
				ans[count] = s[i];
				precount++;
			}else{
				max = Math.max(max,data[count]);
				count++;
			}
		} 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])) {
				data[count]++;
				ans[count] = s[i];
				precount++;
			}else{
				max = Math.max(max,data[count]);
				count++;
			}
		} {
			if (s[i].equals(s[i+1])) {
				data[count]++;
				ans[count] = s[i];
				precount++;
			}else{
				max = Math.max(max,data[count]);
				count++;
			}
		} if (s[i].equals(s[i+1])) {
				data[count]++;
				ans[count] = s[i];
				precount++;
			}else{
				max = Math.max(max,data[count]);
				count++;
			} s[i].equals(s[i+1]) s[i].equals s[i] s i s[i+1] s i+1 i 1 {
				data[count]++;
				ans[count] = s[i];
				precount++;
			} data[count]++ data[count] data count ans[count] = s[i] ans[count] ans count s[i] s i precount++ precount {
				max = Math.max(max,data[count]);
				count++;
			} max = Math.max(max,data[count]) max Math.max(max,data[count]) Math.max Math max data[count] data count count++ count max = Math.max(max,data[count]) max Math.max(max,data[count]) Math.max Math max data[count] data count if (n-1==precount) {
			System.out.println(ans[0]);
			System.exit(0);
		} n-1==precount n-1 n 1 precount {
			System.out.println(ans[0]);
			System.exit(0);
		} System.out.println(ans[0]) System.out.println System.out System System.out ans[0] ans 0 System.exit(0) System.exit System 0 for (int i = 0;i<n ;i++ ) {
			if (max==data[i]) {
				System.out.println(ans[i]);
			}
		} int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
			if (max==data[i]) {
				System.out.println(ans[i]);
			}
		} {
			if (max==data[i]) {
				System.out.println(ans[i]);
			}
		} if (max==data[i]) {
				System.out.println(ans[i]);
			} max==data[i] max data[i] data i {
				System.out.println(ans[i]);
			} System.out.println(ans[i]) System.out.println System.out System System.out ans[i] ans i String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		String s[] = new String[n];
		int data[] = new int [n];
		int count = 0;
		int max = 0;
		String ans[] = new String[n];
		int precount = 0;

		for (int i = 0;i<n ;i++ ) {
			s[i] = sc.next();
			ans[i] = s[i];
		}

		Arrays.sort(s);
		Arrays.sort(ans);

		for (int i = 0;i<n-1 ;i++ ) {
			if (s[i].equals(s[i+1])) {
				data[count]++;
				ans[count] = s[i];
				precount++;
			}else{
				max = Math.max(max,data[count]);
				count++;
			}
		}
		max = Math.max(max,data[count]);
		if (n-1==precount) {
			System.out.println(ans[0]);
			System.exit(0);
		}

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




	}
} public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		String s[] = new String[n];
		int data[] = new int [n];
		int count = 0;
		int max = 0;
		String ans[] = new String[n];
		int precount = 0;

		for (int i = 0;i<n ;i++ ) {
			s[i] = sc.next();
			ans[i] = s[i];
		}

		Arrays.sort(s);
		Arrays.sort(ans);

		for (int i = 0;i<n-1 ;i++ ) {
			if (s[i].equals(s[i+1])) {
				data[count]++;
				ans[count] = s[i];
				precount++;
			}else{
				max = Math.max(max,data[count]);
				count++;
			}
		}
		max = Math.max(max,data[count]);
		if (n-1==precount) {
			System.out.println(ans[0]);
			System.exit(0);
		}

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




	}
} Main
import java.util.*;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		String s[] = new String[n];
		int data[] = new int [n];
		int count = 0;
		int max = 0;
		String ans[] = new String[n];
		int precount = 0;

		for (int i = 0;i<n ;i++ ) {
			s[i] = sc.next();
			ans[i] = s[i];
		}

		Arrays.sort(s);
		Arrays.sort(ans);

		for (int i = 0;i<n-1 ;i++ ) {
			if (s[i].equals(s[i+1])) {
				data[count]++;
				ans[count] = s[i];
				precount++;
			}else{
				max = Math.max(max,data[count]);
				count++;
			}
		}
		max = Math.max(max,data[count]);
		if (n-1==precount) {
			System.out.println(ans[0]);
			System.exit(0);
		}

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




	}
}
