import java.io.InputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}

		sc.close();

		HashMap<String, Integer> m = new HashMap<>();

		int max = 0;

		for (int i = 0; i < N; i++) {
			if (!m.containsKey(S[i])) {
				m.put(S[i], 1);
				max = Math.max(max, 1);
			} else {
				int x = m.get(S[i]);
				x++;
				max = Math.max(max, x);
				m.put(S[i], x);
			}
		}

		List<String> result = new ArrayList<>();

		for (Entry<String, Integer> e : m.entrySet()) {
			if (e.getValue() == max) {
				result.add(e.getKey());
			}
		}

		result.sort(Comparator.naturalOrder());

		for (String s : result) {
			out.println(s);
		}
	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Comparator; Comparator java.util import java.util.HashMap; HashMap java.util import java.util.List; List java.util import java.util.Map.Entry; Entry java.util.Map import java.util.Scanner; Scanner java.util public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}

		sc.close();

		HashMap<String, Integer> m = new HashMap<>();

		int max = 0;

		for (int i = 0; i < N; i++) {
			if (!m.containsKey(S[i])) {
				m.put(S[i], 1);
				max = Math.max(max, 1);
			} else {
				int x = m.get(S[i]);
				x++;
				max = Math.max(max, x);
				m.put(S[i], x);
			}
		}

		List<String> result = new ArrayList<>();

		for (Entry<String, Integer> e : m.entrySet()) {
			if (e.getValue() == max) {
				result.add(e.getKey());
			}
		}

		result.sort(Comparator.naturalOrder());

		for (String s : result) {
			out.println(s);
		}
	}

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

		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}

		sc.close();

		HashMap<String, Integer> m = new HashMap<>();

		int max = 0;

		for (int i = 0; i < N; i++) {
			if (!m.containsKey(S[i])) {
				m.put(S[i], 1);
				max = Math.max(max, 1);
			} else {
				int x = m.get(S[i]);
				x++;
				max = Math.max(max, x);
				m.put(S[i], x);
			}
		}

		List<String> result = new ArrayList<>();

		for (Entry<String, Integer> e : m.entrySet()) {
			if (e.getValue() == max) {
				result.add(e.getKey());
			}
		}

		result.sort(Comparator.naturalOrder());

		for (String s : result) {
			out.println(s);
		}
	} _main {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}

		sc.close();

		HashMap<String, Integer> m = new HashMap<>();

		int max = 0;

		for (int i = 0; i < N; i++) {
			if (!m.containsKey(S[i])) {
				m.put(S[i], 1);
				max = Math.max(max, 1);
			} else {
				int x = m.get(S[i]);
				x++;
				max = Math.max(max, x);
				m.put(S[i], x);
			}
		}

		List<String> result = new ArrayList<>();

		for (Entry<String, Integer> e : m.entrySet()) {
			if (e.getValue() == max) {
				result.add(e.getKey());
			}
		}

		result.sort(Comparator.naturalOrder());

		for (String s : result) {
			out.println(s);
		}
	} Scanner sc = new Scanner(in); sc new Scanner(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 sc.close() sc.close sc HashMap<String, Integer> m = new HashMap<>(); m new HashMap<>() int max = 0; max 0 for (int i = 0; i < N; i++) {
			if (!m.containsKey(S[i])) {
				m.put(S[i], 1);
				max = Math.max(max, 1);
			} else {
				int x = m.get(S[i]);
				x++;
				max = Math.max(max, x);
				m.put(S[i], x);
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			if (!m.containsKey(S[i])) {
				m.put(S[i], 1);
				max = Math.max(max, 1);
			} else {
				int x = m.get(S[i]);
				x++;
				max = Math.max(max, x);
				m.put(S[i], x);
			}
		} {
			if (!m.containsKey(S[i])) {
				m.put(S[i], 1);
				max = Math.max(max, 1);
			} else {
				int x = m.get(S[i]);
				x++;
				max = Math.max(max, x);
				m.put(S[i], x);
			}
		} if (!m.containsKey(S[i])) {
				m.put(S[i], 1);
				max = Math.max(max, 1);
			} else {
				int x = m.get(S[i]);
				x++;
				max = Math.max(max, x);
				m.put(S[i], x);
			} !m.containsKey(S[i]) m.containsKey(S[i]) m.containsKey m S[i] S i {
				m.put(S[i], 1);
				max = Math.max(max, 1);
			} m.put(S[i], 1) m.put m S[i] S i 1 max = Math.max(max, 1) max Math.max(max, 1) Math.max Math max 1 {
				int x = m.get(S[i]);
				x++;
				max = Math.max(max, x);
				m.put(S[i], x);
			} int x = m.get(S[i]); x m.get(S[i]) m.get m S[i] S i x++ x max = Math.max(max, x) max Math.max(max, x) Math.max Math max x m.put(S[i], x) m.put m S[i] S i x List<String> result = new ArrayList<>(); result new ArrayList<>() for (Entry<String, Integer> e : m.entrySet()) {
			if (e.getValue() == max) {
				result.add(e.getKey());
			}
		} Entry<String, Integer> e m.entrySet() m.entrySet m {
			if (e.getValue() == max) {
				result.add(e.getKey());
			}
		} {
			if (e.getValue() == max) {
				result.add(e.getKey());
			}
		} if (e.getValue() == max) {
				result.add(e.getKey());
			} e.getValue() == max e.getValue() e.getValue e max {
				result.add(e.getKey());
			} result.add(e.getKey()) result.add result e.getKey() e.getKey e result.sort(Comparator.naturalOrder()) result.sort result Comparator.naturalOrder() Comparator.naturalOrder Comparator for (String s : result) {
			out.println(s);
		} String s result {
			out.println(s);
		} {
			out.println(s);
		} out.println(s) out.println out s String[] args args public static void main(String[] args) {
		new Main()._main(args);
	} main {
		new Main()._main(args);
	} new Main()._main(args) new Main()._main new Main() args String[] args args public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}

		sc.close();

		HashMap<String, Integer> m = new HashMap<>();

		int max = 0;

		for (int i = 0; i < N; i++) {
			if (!m.containsKey(S[i])) {
				m.put(S[i], 1);
				max = Math.max(max, 1);
			} else {
				int x = m.get(S[i]);
				x++;
				max = Math.max(max, x);
				m.put(S[i], x);
			}
		}

		List<String> result = new ArrayList<>();

		for (Entry<String, Integer> e : m.entrySet()) {
			if (e.getValue() == max) {
				result.add(e.getKey());
			}
		}

		result.sort(Comparator.naturalOrder());

		for (String s : result) {
			out.println(s);
		}
	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
} public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}

		sc.close();

		HashMap<String, Integer> m = new HashMap<>();

		int max = 0;

		for (int i = 0; i < N; i++) {
			if (!m.containsKey(S[i])) {
				m.put(S[i], 1);
				max = Math.max(max, 1);
			} else {
				int x = m.get(S[i]);
				x++;
				max = Math.max(max, x);
				m.put(S[i], x);
			}
		}

		List<String> result = new ArrayList<>();

		for (Entry<String, Integer> e : m.entrySet()) {
			if (e.getValue() == max) {
				result.add(e.getKey());
			}
		}

		result.sort(Comparator.naturalOrder());

		for (String s : result) {
			out.println(s);
		}
	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}

		sc.close();

		HashMap<String, Integer> m = new HashMap<>();

		int max = 0;

		for (int i = 0; i < N; i++) {
			if (!m.containsKey(S[i])) {
				m.put(S[i], 1);
				max = Math.max(max, 1);
			} else {
				int x = m.get(S[i]);
				x++;
				max = Math.max(max, x);
				m.put(S[i], x);
			}
		}

		List<String> result = new ArrayList<>();

		for (Entry<String, Integer> e : m.entrySet()) {
			if (e.getValue() == max) {
				result.add(e.getKey());
			}
		}

		result.sort(Comparator.naturalOrder());

		for (String s : result) {
			out.println(s);
		}
	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
}
