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 S[] = new String[N];

		for (int i = 0; i < N; i ++) {
			S[i] = sc.next();
		}
		Arrays.sort(S);

		int count[] = new int[N];
		Arrays.fill(count, 1);

		int max = 0;
		for (int i = 1; i < N; i++) {
			if (S[i].equals(S[i-1])) {
				count[i] = count[i-1]+1;
			}
			if (max < count[i]) max = count[i];
		}

		for (int i = 0; i < N; i++) {
			if (count[i] == max) {
				System.out.println(S[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 S[] = new String[N];

		for (int i = 0; i < N; i ++) {
			S[i] = sc.next();
		}
		Arrays.sort(S);

		int count[] = new int[N];
		Arrays.fill(count, 1);

		int max = 0;
		for (int i = 1; i < N; i++) {
			if (S[i].equals(S[i-1])) {
				count[i] = count[i-1]+1;
			}
			if (max < count[i]) max = count[i];
		}

		for (int i = 0; i < N; i++) {
			if (count[i] == max) {
				System.out.println(S[i]);
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String S[] = new String[N];

		for (int i = 0; i < N; i ++) {
			S[i] = sc.next();
		}
		Arrays.sort(S);

		int count[] = new int[N];
		Arrays.fill(count, 1);

		int max = 0;
		for (int i = 1; i < N; i++) {
			if (S[i].equals(S[i-1])) {
				count[i] = count[i-1]+1;
			}
			if (max < count[i]) max = count[i];
		}

		for (int i = 0; i < N; i++) {
			if (count[i] == max) {
				System.out.println(S[i]);
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String S[] = new String[N];

		for (int i = 0; i < N; i ++) {
			S[i] = sc.next();
		}
		Arrays.sort(S);

		int count[] = new int[N];
		Arrays.fill(count, 1);

		int max = 0;
		for (int i = 1; i < N; i++) {
			if (S[i].equals(S[i-1])) {
				count[i] = count[i-1]+1;
			}
			if (max < count[i]) max = count[i];
		}

		for (int i = 0; i < N; i++) {
			if (count[i] == max) {
				System.out.println(S[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 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 int count[] = new int[N]; count new int[N] N Arrays.fill(count, 1) Arrays.fill Arrays count 1 int max = 0; max 0 for (int i = 1; i < N; i++) {
			if (S[i].equals(S[i-1])) {
				count[i] = count[i-1]+1;
			}
			if (max < count[i]) max = count[i];
		} int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
			if (S[i].equals(S[i-1])) {
				count[i] = count[i-1]+1;
			}
			if (max < count[i]) max = count[i];
		} {
			if (S[i].equals(S[i-1])) {
				count[i] = count[i-1]+1;
			}
			if (max < count[i]) max = count[i];
		} if (S[i].equals(S[i-1])) {
				count[i] = count[i-1]+1;
			} S[i].equals(S[i-1]) S[i].equals S[i] S i S[i-1] S i-1 i 1 {
				count[i] = count[i-1]+1;
			} count[i] = count[i-1]+1 count[i] count i count[i-1]+1 count[i-1] count i-1 i 1 1 if (max < count[i]) max = count[i]; max < count[i] max count[i] count i max = count[i] max count[i] count i for (int i = 0; i < N; i++) {
			if (count[i] == max) {
				System.out.println(S[i]);
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			if (count[i] == max) {
				System.out.println(S[i]);
			}
		} {
			if (count[i] == max) {
				System.out.println(S[i]);
			}
		} if (count[i] == max) {
				System.out.println(S[i]);
			} count[i] == max count[i] count i max {
				System.out.println(S[i]);
			} System.out.println(S[i]) System.out.println System.out System System.out S[i] S 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];

		for (int i = 0; i < N; i ++) {
			S[i] = sc.next();
		}
		Arrays.sort(S);

		int count[] = new int[N];
		Arrays.fill(count, 1);

		int max = 0;
		for (int i = 1; i < N; i++) {
			if (S[i].equals(S[i-1])) {
				count[i] = count[i-1]+1;
			}
			if (max < count[i]) max = count[i];
		}

		for (int i = 0; i < N; i++) {
			if (count[i] == max) {
				System.out.println(S[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];

		for (int i = 0; i < N; i ++) {
			S[i] = sc.next();
		}
		Arrays.sort(S);

		int count[] = new int[N];
		Arrays.fill(count, 1);

		int max = 0;
		for (int i = 1; i < N; i++) {
			if (S[i].equals(S[i-1])) {
				count[i] = count[i-1]+1;
			}
			if (max < count[i]) max = count[i];
		}

		for (int i = 0; i < N; i++) {
			if (count[i] == max) {
				System.out.println(S[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 S[] = new String[N];

		for (int i = 0; i < N; i ++) {
			S[i] = sc.next();
		}
		Arrays.sort(S);

		int count[] = new int[N];
		Arrays.fill(count, 1);

		int max = 0;
		for (int i = 1; i < N; i++) {
			if (S[i].equals(S[i-1])) {
				count[i] = count[i-1]+1;
			}
			if (max < count[i]) max = count[i];
		}

		for (int i = 0; i < N; i++) {
			if (count[i] == max) {
				System.out.println(S[i]);
			}
		}
	}
}