import java.util.*;

class Main {
	Scanner sc;
	int N;
	Map<String, Integer> map;
	
	private void calc() {
		sc = new Scanner(System.in);
		N = sc.nextInt();
		map = new TreeMap<>();
		int max = -1;
		for (int i = 0; i < N; i++) {
			String s = sc.next();
			int c = map.getOrDefault(s, 0) + 1;
			max = Math.max(max, c);
			map.put(s, c);
		}
		for (String s : map.keySet()) {
			if (map.get(s) == max) System.out.println(s);
		}
	}

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

/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