import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		Map<String, Integer> mm = new HashMap<>();

		for (int i = 0; i < n; i++) {
			String t = sc.next();
			if (mm.containsKey(t)) {
				mm.put(t, (mm.get(t) + 1));
			} else {
				mm.put(t, 1);
			}

			if (mm.get(t) > max) {
				max = mm.get(t);
			}
		}

		List<String> result = new ArrayList<>();
		for (String str : mm.keySet()) {
			if (mm.get(str) == max) {
				result.add(str);
			}
		}

		Collections.sort(result);

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

		sc.close();

	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		Map<String, Integer> mm = new HashMap<>();

		for (int i = 0; i < n; i++) {
			String t = sc.next();
			if (mm.containsKey(t)) {
				mm.put(t, (mm.get(t) + 1));
			} else {
				mm.put(t, 1);
			}

			if (mm.get(t) > max) {
				max = mm.get(t);
			}
		}

		List<String> result = new ArrayList<>();
		for (String str : mm.keySet()) {
			if (mm.get(str) == max) {
				result.add(str);
			}
		}

		Collections.sort(result);

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

		sc.close();

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		Map<String, Integer> mm = new HashMap<>();

		for (int i = 0; i < n; i++) {
			String t = sc.next();
			if (mm.containsKey(t)) {
				mm.put(t, (mm.get(t) + 1));
			} else {
				mm.put(t, 1);
			}

			if (mm.get(t) > max) {
				max = mm.get(t);
			}
		}

		List<String> result = new ArrayList<>();
		for (String str : mm.keySet()) {
			if (mm.get(str) == max) {
				result.add(str);
			}
		}

		Collections.sort(result);

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

		sc.close();

	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		Map<String, Integer> mm = new HashMap<>();

		for (int i = 0; i < n; i++) {
			String t = sc.next();
			if (mm.containsKey(t)) {
				mm.put(t, (mm.get(t) + 1));
			} else {
				mm.put(t, 1);
			}

			if (mm.get(t) > max) {
				max = mm.get(t);
			}
		}

		List<String> result = new ArrayList<>();
		for (String str : mm.keySet()) {
			if (mm.get(str) == max) {
				result.add(str);
			}
		}

		Collections.sort(result);

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

		sc.close();

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int max = 0; max 0 Map<String, Integer> mm = new HashMap<>(); mm new HashMap<>() for (int i = 0; i < n; i++) {
			String t = sc.next();
			if (mm.containsKey(t)) {
				mm.put(t, (mm.get(t) + 1));
			} else {
				mm.put(t, 1);
			}

			if (mm.get(t) > max) {
				max = mm.get(t);
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String t = sc.next();
			if (mm.containsKey(t)) {
				mm.put(t, (mm.get(t) + 1));
			} else {
				mm.put(t, 1);
			}

			if (mm.get(t) > max) {
				max = mm.get(t);
			}
		} {
			String t = sc.next();
			if (mm.containsKey(t)) {
				mm.put(t, (mm.get(t) + 1));
			} else {
				mm.put(t, 1);
			}

			if (mm.get(t) > max) {
				max = mm.get(t);
			}
		} String t = sc.next(); t sc.next() sc.next sc if (mm.containsKey(t)) {
				mm.put(t, (mm.get(t) + 1));
			} else {
				mm.put(t, 1);
			} mm.containsKey(t) mm.containsKey mm t {
				mm.put(t, (mm.get(t) + 1));
			} mm.put(t, (mm.get(t) + 1)) mm.put mm t (mm.get(t) + 1) mm.get(t) mm.get mm t 1 {
				mm.put(t, 1);
			} mm.put(t, 1) mm.put mm t 1 if (mm.get(t) > max) {
				max = mm.get(t);
			} mm.get(t) > max mm.get(t) mm.get mm t max {
				max = mm.get(t);
			} max = mm.get(t) max mm.get(t) mm.get mm t List<String> result = new ArrayList<>(); result new ArrayList<>() for (String str : mm.keySet()) {
			if (mm.get(str) == max) {
				result.add(str);
			}
		} String str mm.keySet() mm.keySet mm {
			if (mm.get(str) == max) {
				result.add(str);
			}
		} {
			if (mm.get(str) == max) {
				result.add(str);
			}
		} if (mm.get(str) == max) {
				result.add(str);
			} mm.get(str) == max mm.get(str) mm.get mm str max {
				result.add(str);
			} result.add(str) result.add result str Collections.sort(result) Collections.sort Collections result for (String s : result) {
			System.out.println(s);
		} String s result {
			System.out.println(s);
		} {
			System.out.println(s);
		} System.out.println(s) System.out.println System.out System System.out s sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		Map<String, Integer> mm = new HashMap<>();

		for (int i = 0; i < n; i++) {
			String t = sc.next();
			if (mm.containsKey(t)) {
				mm.put(t, (mm.get(t) + 1));
			} else {
				mm.put(t, 1);
			}

			if (mm.get(t) > max) {
				max = mm.get(t);
			}
		}

		List<String> result = new ArrayList<>();
		for (String str : mm.keySet()) {
			if (mm.get(str) == max) {
				result.add(str);
			}
		}

		Collections.sort(result);

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

		sc.close();

	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		Map<String, Integer> mm = new HashMap<>();

		for (int i = 0; i < n; i++) {
			String t = sc.next();
			if (mm.containsKey(t)) {
				mm.put(t, (mm.get(t) + 1));
			} else {
				mm.put(t, 1);
			}

			if (mm.get(t) > max) {
				max = mm.get(t);
			}
		}

		List<String> result = new ArrayList<>();
		for (String str : mm.keySet()) {
			if (mm.get(str) == max) {
				result.add(str);
			}
		}

		Collections.sort(result);

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

		sc.close();

	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		Map<String, Integer> mm = new HashMap<>();

		for (int i = 0; i < n; i++) {
			String t = sc.next();
			if (mm.containsKey(t)) {
				mm.put(t, (mm.get(t) + 1));
			} else {
				mm.put(t, 1);
			}

			if (mm.get(t) > max) {
				max = mm.get(t);
			}
		}

		List<String> result = new ArrayList<>();
		for (String str : mm.keySet()) {
			if (mm.get(str) == max) {
				result.add(str);
			}
		}

		Collections.sort(result);

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

		sc.close();

	}
}
