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

class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}
		Arrays.sort(S);
		String current = "";
		int streak = 0;
		int max = 0;
		for (String s : S) {
			if (!s.equals(current)){
				max = Math.max(max, streak);
				streak = 1;
				current = s;
			} else {
				streak += 1;
			}
		}
		max = Math.max(max, streak);
		current = "";
		streak = 0;
		for (String s : S) {
			if (!s.equals(current)){
				if (streak == max){
					System.out.println(current);
				}
				streak = 1;
				current = s;
			} else {
				streak += 1;
			}
		}
		if (streak == max){
			System.out.println(current);
		}
	}
}

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

		Solver.INSTANCE.solve(in);

		in.close();
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}
		Arrays.sort(S);
		String current = "";
		int streak = 0;
		int max = 0;
		for (String s : S) {
			if (!s.equals(current)){
				max = Math.max(max, streak);
				streak = 1;
				current = s;
			} else {
				streak += 1;
			}
		}
		max = Math.max(max, streak);
		current = "";
		streak = 0;
		for (String s : S) {
			if (!s.equals(current)){
				if (streak == max){
					System.out.println(current);
				}
				streak = 1;
				current = s;
			} else {
				streak += 1;
			}
		}
		if (streak == max){
			System.out.println(current);
		}
	}
} Solver static final Solver INSTANCE = new Solver(); INSTANCE new Solver() void solve(Scanner sc) {
		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}
		Arrays.sort(S);
		String current = "";
		int streak = 0;
		int max = 0;
		for (String s : S) {
			if (!s.equals(current)){
				max = Math.max(max, streak);
				streak = 1;
				current = s;
			} else {
				streak += 1;
			}
		}
		max = Math.max(max, streak);
		current = "";
		streak = 0;
		for (String s : S) {
			if (!s.equals(current)){
				if (streak == max){
					System.out.println(current);
				}
				streak = 1;
				current = s;
			} else {
				streak += 1;
			}
		}
		if (streak == max){
			System.out.println(current);
		}
	} solve {
		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}
		Arrays.sort(S);
		String current = "";
		int streak = 0;
		int max = 0;
		for (String s : S) {
			if (!s.equals(current)){
				max = Math.max(max, streak);
				streak = 1;
				current = s;
			} else {
				streak += 1;
			}
		}
		max = Math.max(max, streak);
		current = "";
		streak = 0;
		for (String s : S) {
			if (!s.equals(current)){
				if (streak == max){
					System.out.println(current);
				}
				streak = 1;
				current = s;
			} else {
				streak += 1;
			}
		}
		if (streak == max){
			System.out.println(current);
		}
	} int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc String[] S = new String[N]; S new String[N] N 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.sort(S) Arrays.sort Arrays S String current = ""; current "" int streak = 0; streak 0 int max = 0; max 0 for (String s : S) {
			if (!s.equals(current)){
				max = Math.max(max, streak);
				streak = 1;
				current = s;
			} else {
				streak += 1;
			}
		} String s S {
			if (!s.equals(current)){
				max = Math.max(max, streak);
				streak = 1;
				current = s;
			} else {
				streak += 1;
			}
		} {
			if (!s.equals(current)){
				max = Math.max(max, streak);
				streak = 1;
				current = s;
			} else {
				streak += 1;
			}
		} if (!s.equals(current)){
				max = Math.max(max, streak);
				streak = 1;
				current = s;
			} else {
				streak += 1;
			} !s.equals(current) s.equals(current) s.equals s current {
				max = Math.max(max, streak);
				streak = 1;
				current = s;
			} max = Math.max(max, streak) max Math.max(max, streak) Math.max Math max streak streak = 1 streak 1 current = s current s {
				streak += 1;
			} streak += 1 streak 1 max = Math.max(max, streak) max Math.max(max, streak) Math.max Math max streak current = "" current "" streak = 0 streak 0 for (String s : S) {
			if (!s.equals(current)){
				if (streak == max){
					System.out.println(current);
				}
				streak = 1;
				current = s;
			} else {
				streak += 1;
			}
		} String s S {
			if (!s.equals(current)){
				if (streak == max){
					System.out.println(current);
				}
				streak = 1;
				current = s;
			} else {
				streak += 1;
			}
		} {
			if (!s.equals(current)){
				if (streak == max){
					System.out.println(current);
				}
				streak = 1;
				current = s;
			} else {
				streak += 1;
			}
		} if (!s.equals(current)){
				if (streak == max){
					System.out.println(current);
				}
				streak = 1;
				current = s;
			} else {
				streak += 1;
			} !s.equals(current) s.equals(current) s.equals s current {
				if (streak == max){
					System.out.println(current);
				}
				streak = 1;
				current = s;
			} if (streak == max){
					System.out.println(current);
				} streak == max streak max {
					System.out.println(current);
				} System.out.println(current) System.out.println System.out System System.out current streak = 1 streak 1 current = s current s {
				streak += 1;
			} streak += 1 streak 1 if (streak == max){
			System.out.println(current);
		} streak == max streak max {
			System.out.println(current);
		} System.out.println(current) System.out.println System.out System System.out current Scanner sc sc class Main {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

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

		Solver.INSTANCE.solve(in);

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

		Solver.INSTANCE.solve(in);

		in.close();
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) Solver.INSTANCE.solve(in) Solver.INSTANCE.solve Solver.INSTANCE Solver Solver.INSTANCE in in.close() in.close in String... args args
import java.util.Arrays;
import java.util.Scanner;

class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}
		Arrays.sort(S);
		String current = "";
		int streak = 0;
		int max = 0;
		for (String s : S) {
			if (!s.equals(current)){
				max = Math.max(max, streak);
				streak = 1;
				current = s;
			} else {
				streak += 1;
			}
		}
		max = Math.max(max, streak);
		current = "";
		streak = 0;
		for (String s : S) {
			if (!s.equals(current)){
				if (streak == max){
					System.out.println(current);
				}
				streak = 1;
				current = s;
			} else {
				streak += 1;
			}
		}
		if (streak == max){
			System.out.println(current);
		}
	}
}

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

		Solver.INSTANCE.solve(in);

		in.close();
	}
}