
import java.util.*;

/**
 * Main
 */
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new HashMap<>();
		int maxCount = 1;

		for (int j = 0; j < n; j++) {
			String word = sc.next();
			if (map.containsKey(word)) {
				map.replace(word, map.get(word) + 1);
				maxCount = Math.max(maxCount, map.get(word));
			} else {
				map.put(word, 1);
			}
		}
		sc.close();

		Map<String, Integer> result = new TreeMap<>();
		for (Map.Entry<String, Integer> entry : map.entrySet()) {
			if (entry.getValue() == maxCount) {
				result.put(entry.getKey(), null);
			}
		}

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

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

		for (int j = 0; j < n; j++) {
			String word = sc.next();
			if (map.containsKey(word)) {
				map.replace(word, map.get(word) + 1);
				maxCount = Math.max(maxCount, map.get(word));
			} else {
				map.put(word, 1);
			}
		}
		sc.close();

		Map<String, Integer> result = new TreeMap<>();
		for (Map.Entry<String, Integer> entry : map.entrySet()) {
			if (entry.getValue() == maxCount) {
				result.put(entry.getKey(), null);
			}
		}

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

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

		for (int j = 0; j < n; j++) {
			String word = sc.next();
			if (map.containsKey(word)) {
				map.replace(word, map.get(word) + 1);
				maxCount = Math.max(maxCount, map.get(word));
			} else {
				map.put(word, 1);
			}
		}
		sc.close();

		Map<String, Integer> result = new TreeMap<>();
		for (Map.Entry<String, Integer> entry : map.entrySet()) {
			if (entry.getValue() == maxCount) {
				result.put(entry.getKey(), null);
			}
		}

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

	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new HashMap<>();
		int maxCount = 1;

		for (int j = 0; j < n; j++) {
			String word = sc.next();
			if (map.containsKey(word)) {
				map.replace(word, map.get(word) + 1);
				maxCount = Math.max(maxCount, map.get(word));
			} else {
				map.put(word, 1);
			}
		}
		sc.close();

		Map<String, Integer> result = new TreeMap<>();
		for (Map.Entry<String, Integer> entry : map.entrySet()) {
			if (entry.getValue() == maxCount) {
				result.put(entry.getKey(), null);
			}
		}

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

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Map<String, Integer> map = new HashMap<>(); map new HashMap<>() int maxCount = 1; maxCount 1 for (int j = 0; j < n; j++) {
			String word = sc.next();
			if (map.containsKey(word)) {
				map.replace(word, map.get(word) + 1);
				maxCount = Math.max(maxCount, map.get(word));
			} else {
				map.put(word, 1);
			}
		} int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
			String word = sc.next();
			if (map.containsKey(word)) {
				map.replace(word, map.get(word) + 1);
				maxCount = Math.max(maxCount, map.get(word));
			} else {
				map.put(word, 1);
			}
		} {
			String word = sc.next();
			if (map.containsKey(word)) {
				map.replace(word, map.get(word) + 1);
				maxCount = Math.max(maxCount, map.get(word));
			} else {
				map.put(word, 1);
			}
		} String word = sc.next(); word sc.next() sc.next sc if (map.containsKey(word)) {
				map.replace(word, map.get(word) + 1);
				maxCount = Math.max(maxCount, map.get(word));
			} else {
				map.put(word, 1);
			} map.containsKey(word) map.containsKey map word {
				map.replace(word, map.get(word) + 1);
				maxCount = Math.max(maxCount, map.get(word));
			} map.replace(word, map.get(word) + 1) map.replace map word map.get(word) + 1 map.get(word) map.get map word 1 maxCount = Math.max(maxCount, map.get(word)) maxCount Math.max(maxCount, map.get(word)) Math.max Math maxCount map.get(word) map.get map word {
				map.put(word, 1);
			} map.put(word, 1) map.put map word 1 sc.close() sc.close sc Map<String, Integer> result = new TreeMap<>(); result new TreeMap<>() for (Map.Entry<String, Integer> entry : map.entrySet()) {
			if (entry.getValue() == maxCount) {
				result.put(entry.getKey(), null);
			}
		} Map.Entry<String, Integer> entry map.entrySet() map.entrySet map {
			if (entry.getValue() == maxCount) {
				result.put(entry.getKey(), null);
			}
		} {
			if (entry.getValue() == maxCount) {
				result.put(entry.getKey(), null);
			}
		} if (entry.getValue() == maxCount) {
				result.put(entry.getKey(), null);
			} entry.getValue() == maxCount entry.getValue() entry.getValue entry maxCount {
				result.put(entry.getKey(), null);
			} result.put(entry.getKey(), null) result.put result entry.getKey() entry.getKey entry null for (String word : result.keySet()) {
			System.out.println(word);
		} String word result.keySet() result.keySet result {
			System.out.println(word);
		} {
			System.out.println(word);
		} System.out.println(word) System.out.println System.out System System.out word String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new HashMap<>();
		int maxCount = 1;

		for (int j = 0; j < n; j++) {
			String word = sc.next();
			if (map.containsKey(word)) {
				map.replace(word, map.get(word) + 1);
				maxCount = Math.max(maxCount, map.get(word));
			} else {
				map.put(word, 1);
			}
		}
		sc.close();

		Map<String, Integer> result = new TreeMap<>();
		for (Map.Entry<String, Integer> entry : map.entrySet()) {
			if (entry.getValue() == maxCount) {
				result.put(entry.getKey(), null);
			}
		}

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

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

		for (int j = 0; j < n; j++) {
			String word = sc.next();
			if (map.containsKey(word)) {
				map.replace(word, map.get(word) + 1);
				maxCount = Math.max(maxCount, map.get(word));
			} else {
				map.put(word, 1);
			}
		}
		sc.close();

		Map<String, Integer> result = new TreeMap<>();
		for (Map.Entry<String, Integer> entry : map.entrySet()) {
			if (entry.getValue() == maxCount) {
				result.put(entry.getKey(), null);
			}
		}

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

	}
} Main

import java.util.*;

/**
 * Main
 */
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new HashMap<>();
		int maxCount = 1;

		for (int j = 0; j < n; j++) {
			String word = sc.next();
			if (map.containsKey(word)) {
				map.replace(word, map.get(word) + 1);
				maxCount = Math.max(maxCount, map.get(word));
			} else {
				map.put(word, 1);
			}
		}
		sc.close();

		Map<String, Integer> result = new TreeMap<>();
		for (Map.Entry<String, Integer> entry : map.entrySet()) {
			if (entry.getValue() == maxCount) {
				result.put(entry.getKey(), null);
			}
		}

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

	}
}