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

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String[] vote = new String[N];
		int i = 0;
		while(i < N) {
			vote[i] = sc.next();

			i++;
		}

		Arrays.sort(vote);
		int maxCounter = 0;
		int[] a = new int[N];
		String[] b = new String[N];
		int j = 0;

		a[0] = 1;
		b[0] = vote[0];

		for(i = 1; i < N; i++) {
			if(vote[i].equals(b[j])) {
				a[j]++;
			}else {
				if(maxCounter < a[j]) {
					maxCounter = a[j];
				}
				j++;
				a[j] = 1;
				b[j] = vote[i];
			}
		}
		if(maxCounter < a[j]) {
			maxCounter = a[j];
		}

		for(i = 0; i<N; i++) {
			if(a[i] == maxCounter) {
				System.out.println(b[i]);
			}
		}

	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String[] vote = new String[N];
		int i = 0;
		while(i < N) {
			vote[i] = sc.next();

			i++;
		}

		Arrays.sort(vote);
		int maxCounter = 0;
		int[] a = new int[N];
		String[] b = new String[N];
		int j = 0;

		a[0] = 1;
		b[0] = vote[0];

		for(i = 1; i < N; i++) {
			if(vote[i].equals(b[j])) {
				a[j]++;
			}else {
				if(maxCounter < a[j]) {
					maxCounter = a[j];
				}
				j++;
				a[j] = 1;
				b[j] = vote[i];
			}
		}
		if(maxCounter < a[j]) {
			maxCounter = a[j];
		}

		for(i = 0; i<N; i++) {
			if(a[i] == maxCounter) {
				System.out.println(b[i]);
			}
		}

	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String[] vote = new String[N];
		int i = 0;
		while(i < N) {
			vote[i] = sc.next();

			i++;
		}

		Arrays.sort(vote);
		int maxCounter = 0;
		int[] a = new int[N];
		String[] b = new String[N];
		int j = 0;

		a[0] = 1;
		b[0] = vote[0];

		for(i = 1; i < N; i++) {
			if(vote[i].equals(b[j])) {
				a[j]++;
			}else {
				if(maxCounter < a[j]) {
					maxCounter = a[j];
				}
				j++;
				a[j] = 1;
				b[j] = vote[i];
			}
		}
		if(maxCounter < a[j]) {
			maxCounter = a[j];
		}

		for(i = 0; i<N; i++) {
			if(a[i] == maxCounter) {
				System.out.println(b[i]);
			}
		}

	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String[] vote = new String[N];
		int i = 0;
		while(i < N) {
			vote[i] = sc.next();

			i++;
		}

		Arrays.sort(vote);
		int maxCounter = 0;
		int[] a = new int[N];
		String[] b = new String[N];
		int j = 0;

		a[0] = 1;
		b[0] = vote[0];

		for(i = 1; i < N; i++) {
			if(vote[i].equals(b[j])) {
				a[j]++;
			}else {
				if(maxCounter < a[j]) {
					maxCounter = a[j];
				}
				j++;
				a[j] = 1;
				b[j] = vote[i];
			}
		}
		if(maxCounter < a[j]) {
			maxCounter = a[j];
		}

		for(i = 0; i<N; i++) {
			if(a[i] == maxCounter) {
				System.out.println(b[i]);
			}
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc String[] vote = new String[N]; vote new String[N] N int i = 0; i 0 while(i < N) {
			vote[i] = sc.next();

			i++;
		} i < N i N {
			vote[i] = sc.next();

			i++;
		} vote[i] = sc.next() vote[i] vote i sc.next() sc.next sc i++ i Arrays.sort(vote) Arrays.sort Arrays vote int maxCounter = 0; maxCounter 0 int[] a = new int[N]; a new int[N] N String[] b = new String[N]; b new String[N] N int j = 0; j 0 a[0] = 1 a[0] a 0 1 b[0] = vote[0] b[0] b 0 vote[0] vote 0 for(i = 1; i < N; i++) {
			if(vote[i].equals(b[j])) {
				a[j]++;
			}else {
				if(maxCounter < a[j]) {
					maxCounter = a[j];
				}
				j++;
				a[j] = 1;
				b[j] = vote[i];
			}
		} i = 1; i = 1 i 1 i < N i N i++ i++ i {
			if(vote[i].equals(b[j])) {
				a[j]++;
			}else {
				if(maxCounter < a[j]) {
					maxCounter = a[j];
				}
				j++;
				a[j] = 1;
				b[j] = vote[i];
			}
		} {
			if(vote[i].equals(b[j])) {
				a[j]++;
			}else {
				if(maxCounter < a[j]) {
					maxCounter = a[j];
				}
				j++;
				a[j] = 1;
				b[j] = vote[i];
			}
		} if(vote[i].equals(b[j])) {
				a[j]++;
			}else {
				if(maxCounter < a[j]) {
					maxCounter = a[j];
				}
				j++;
				a[j] = 1;
				b[j] = vote[i];
			} vote[i].equals(b[j]) vote[i].equals vote[i] vote i b[j] b j {
				a[j]++;
			} a[j]++ a[j] a j {
				if(maxCounter < a[j]) {
					maxCounter = a[j];
				}
				j++;
				a[j] = 1;
				b[j] = vote[i];
			} if(maxCounter < a[j]) {
					maxCounter = a[j];
				} maxCounter < a[j] maxCounter a[j] a j {
					maxCounter = a[j];
				} maxCounter = a[j] maxCounter a[j] a j j++ j a[j] = 1 a[j] a j 1 b[j] = vote[i] b[j] b j vote[i] vote i if(maxCounter < a[j]) {
			maxCounter = a[j];
		} maxCounter < a[j] maxCounter a[j] a j {
			maxCounter = a[j];
		} maxCounter = a[j] maxCounter a[j] a j for(i = 0; i<N; i++) {
			if(a[i] == maxCounter) {
				System.out.println(b[i]);
			}
		} i = 0; i = 0 i 0 i<N i N i++ i++ i {
			if(a[i] == maxCounter) {
				System.out.println(b[i]);
			}
		} {
			if(a[i] == maxCounter) {
				System.out.println(b[i]);
			}
		} if(a[i] == maxCounter) {
				System.out.println(b[i]);
			} a[i] == maxCounter a[i] a i maxCounter {
				System.out.println(b[i]);
			} System.out.println(b[i]) System.out.println System.out System System.out b[i] b i String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String[] vote = new String[N];
		int i = 0;
		while(i < N) {
			vote[i] = sc.next();

			i++;
		}

		Arrays.sort(vote);
		int maxCounter = 0;
		int[] a = new int[N];
		String[] b = new String[N];
		int j = 0;

		a[0] = 1;
		b[0] = vote[0];

		for(i = 1; i < N; i++) {
			if(vote[i].equals(b[j])) {
				a[j]++;
			}else {
				if(maxCounter < a[j]) {
					maxCounter = a[j];
				}
				j++;
				a[j] = 1;
				b[j] = vote[i];
			}
		}
		if(maxCounter < a[j]) {
			maxCounter = a[j];
		}

		for(i = 0; i<N; i++) {
			if(a[i] == maxCounter) {
				System.out.println(b[i]);
			}
		}

	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String[] vote = new String[N];
		int i = 0;
		while(i < N) {
			vote[i] = sc.next();

			i++;
		}

		Arrays.sort(vote);
		int maxCounter = 0;
		int[] a = new int[N];
		String[] b = new String[N];
		int j = 0;

		a[0] = 1;
		b[0] = vote[0];

		for(i = 1; i < N; i++) {
			if(vote[i].equals(b[j])) {
				a[j]++;
			}else {
				if(maxCounter < a[j]) {
					maxCounter = a[j];
				}
				j++;
				a[j] = 1;
				b[j] = vote[i];
			}
		}
		if(maxCounter < a[j]) {
			maxCounter = a[j];
		}

		for(i = 0; i<N; i++) {
			if(a[i] == maxCounter) {
				System.out.println(b[i]);
			}
		}

	}

} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String[] vote = new String[N];
		int i = 0;
		while(i < N) {
			vote[i] = sc.next();

			i++;
		}

		Arrays.sort(vote);
		int maxCounter = 0;
		int[] a = new int[N];
		String[] b = new String[N];
		int j = 0;

		a[0] = 1;
		b[0] = vote[0];

		for(i = 1; i < N; i++) {
			if(vote[i].equals(b[j])) {
				a[j]++;
			}else {
				if(maxCounter < a[j]) {
					maxCounter = a[j];
				}
				j++;
				a[j] = 1;
				b[j] = vote[i];
			}
		}
		if(maxCounter < a[j]) {
			maxCounter = a[j];
		}

		for(i = 0; i<N; i++) {
			if(a[i] == maxCounter) {
				System.out.println(b[i]);
			}
		}

	}

}
