import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.SortedSet;
import java.util.TreeSet;

public class Main {
	public static void main(String[] args) {

		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			Map<String, Integer> map = new HashMap<>();
			int maxCount = 0;
			for (int i = 0; i < n; i++) {
				String si = sc.next();
				int newCount = map.getOrDefault(si, 0) + 1;
				map.put(si, newCount);
				if (maxCount < newCount) {
					maxCount = newCount;
				}
			}
			SortedSet<String> keySet = new TreeSet<>(map.keySet());
			for (String key : keySet) {
				if (map.get(key) == maxCount) {
					System.out.println(key);
				}
			}
		}
	}

} import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util import java.util.SortedSet; SortedSet java.util import java.util.TreeSet; TreeSet java.util public class Main {
	public static void main(String[] args) {

		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			Map<String, Integer> map = new HashMap<>();
			int maxCount = 0;
			for (int i = 0; i < n; i++) {
				String si = sc.next();
				int newCount = map.getOrDefault(si, 0) + 1;
				map.put(si, newCount);
				if (maxCount < newCount) {
					maxCount = newCount;
				}
			}
			SortedSet<String> keySet = new TreeSet<>(map.keySet());
			for (String key : keySet) {
				if (map.get(key) == maxCount) {
					System.out.println(key);
				}
			}
		}
	}

} Main public static void main(String[] args) {

		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			Map<String, Integer> map = new HashMap<>();
			int maxCount = 0;
			for (int i = 0; i < n; i++) {
				String si = sc.next();
				int newCount = map.getOrDefault(si, 0) + 1;
				map.put(si, newCount);
				if (maxCount < newCount) {
					maxCount = newCount;
				}
			}
			SortedSet<String> keySet = new TreeSet<>(map.keySet());
			for (String key : keySet) {
				if (map.get(key) == maxCount) {
					System.out.println(key);
				}
			}
		}
	} main {

		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			Map<String, Integer> map = new HashMap<>();
			int maxCount = 0;
			for (int i = 0; i < n; i++) {
				String si = sc.next();
				int newCount = map.getOrDefault(si, 0) + 1;
				map.put(si, newCount);
				if (maxCount < newCount) {
					maxCount = newCount;
				}
			}
			SortedSet<String> keySet = new TreeSet<>(map.keySet());
			for (String key : keySet) {
				if (map.get(key) == maxCount) {
					System.out.println(key);
				}
			}
		}
	} try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			Map<String, Integer> map = new HashMap<>();
			int maxCount = 0;
			for (int i = 0; i < n; i++) {
				String si = sc.next();
				int newCount = map.getOrDefault(si, 0) + 1;
				map.put(si, newCount);
				if (maxCount < newCount) {
					maxCount = newCount;
				}
			}
			SortedSet<String> keySet = new TreeSet<>(map.keySet());
			for (String key : keySet) {
				if (map.get(key) == maxCount) {
					System.out.println(key);
				}
			}
		} {
			int n = sc.nextInt();
			Map<String, Integer> map = new HashMap<>();
			int maxCount = 0;
			for (int i = 0; i < n; i++) {
				String si = sc.next();
				int newCount = map.getOrDefault(si, 0) + 1;
				map.put(si, newCount);
				if (maxCount < newCount) {
					maxCount = newCount;
				}
			}
			SortedSet<String> keySet = new TreeSet<>(map.keySet());
			for (String key : keySet) {
				if (map.get(key) == maxCount) {
					System.out.println(key);
				}
			}
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) 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 = 0; maxCount 0 for (int i = 0; i < n; i++) {
				String si = sc.next();
				int newCount = map.getOrDefault(si, 0) + 1;
				map.put(si, newCount);
				if (maxCount < newCount) {
					maxCount = newCount;
				}
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				String si = sc.next();
				int newCount = map.getOrDefault(si, 0) + 1;
				map.put(si, newCount);
				if (maxCount < newCount) {
					maxCount = newCount;
				}
			} {
				String si = sc.next();
				int newCount = map.getOrDefault(si, 0) + 1;
				map.put(si, newCount);
				if (maxCount < newCount) {
					maxCount = newCount;
				}
			} String si = sc.next(); si sc.next() sc.next sc int newCount = map.getOrDefault(si, 0) + 1; newCount map.getOrDefault(si, 0) + 1 map.getOrDefault(si, 0) map.getOrDefault map si 0 1 map.put(si, newCount) map.put map si newCount if (maxCount < newCount) {
					maxCount = newCount;
				} maxCount < newCount maxCount newCount {
					maxCount = newCount;
				} maxCount = newCount maxCount newCount SortedSet<String> keySet = new TreeSet<>(map.keySet()); keySet new TreeSet<>(map.keySet()) for (String key : keySet) {
				if (map.get(key) == maxCount) {
					System.out.println(key);
				}
			} String key keySet {
				if (map.get(key) == maxCount) {
					System.out.println(key);
				}
			} {
				if (map.get(key) == maxCount) {
					System.out.println(key);
				}
			} if (map.get(key) == maxCount) {
					System.out.println(key);
				} map.get(key) == maxCount map.get(key) map.get map key maxCount {
					System.out.println(key);
				} System.out.println(key) System.out.println System.out System System.out key String[] args args public class Main {
	public static void main(String[] args) {

		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			Map<String, Integer> map = new HashMap<>();
			int maxCount = 0;
			for (int i = 0; i < n; i++) {
				String si = sc.next();
				int newCount = map.getOrDefault(si, 0) + 1;
				map.put(si, newCount);
				if (maxCount < newCount) {
					maxCount = newCount;
				}
			}
			SortedSet<String> keySet = new TreeSet<>(map.keySet());
			for (String key : keySet) {
				if (map.get(key) == maxCount) {
					System.out.println(key);
				}
			}
		}
	}

} public class Main {
	public static void main(String[] args) {

		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			Map<String, Integer> map = new HashMap<>();
			int maxCount = 0;
			for (int i = 0; i < n; i++) {
				String si = sc.next();
				int newCount = map.getOrDefault(si, 0) + 1;
				map.put(si, newCount);
				if (maxCount < newCount) {
					maxCount = newCount;
				}
			}
			SortedSet<String> keySet = new TreeSet<>(map.keySet());
			for (String key : keySet) {
				if (map.get(key) == maxCount) {
					System.out.println(key);
				}
			}
		}
	}

} Main
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.SortedSet;
import java.util.TreeSet;

public class Main {
	public static void main(String[] args) {

		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			Map<String, Integer> map = new HashMap<>();
			int maxCount = 0;
			for (int i = 0; i < n; i++) {
				String si = sc.next();
				int newCount = map.getOrDefault(si, 0) + 1;
				map.put(si, newCount);
				if (maxCount < newCount) {
					maxCount = newCount;
				}
			}
			SortedSet<String> keySet = new TreeSet<>(map.keySet());
			for (String key : keySet) {
				if (map.get(key) == maxCount) {
					System.out.println(key);
				}
			}
		}
	}

}
