import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int N = sc.nextInt();
		Map<String, Integer> count = new TreeMap<String, Integer>();
		String base = sc.next();
		count.put(base, 1);
		for (int i = 1; i < N; i++) {
			String temp = sc.next();
			if (!count.containsKey(temp)) {
				count.put(temp, 1);
			} else {
				count.replace(temp, (count.get(temp) + 1));
			}
		}
		int temp = 0;
		for (String k : count.keySet()) {
			temp = Math.max(temp, count.get(k));
		}
		for (String k : count.keySet()) {
			if (temp == count.get(k)) {
				System.out.println(k);
			}
		}
	}
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz