// Arup Guha
// 11/15/2014
// Solution to 2014 South East Regional D2 Problem: Polling

import java.util.*;

public class polling {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();

		// Read all items into a tree map.
		TreeMap<String,Integer> map = new TreeMap<String,Integer>();
		int max = 0;
		for (int i=0; i<n; i++) {
			String name = stdin.next();
			int cur = 1;
			if (map.containsKey(name)) cur = map.get(name) + 1;
			map.put(name, cur);
			if (cur > max) max = cur;
		}

		// Print all the names in alpha order that appears max times.
		while (map.size() > 0) {
			String cur = map.firstKey();
			if (map.get(cur) == max) System.out.println(cur);
			map.pollFirstEntry();
		}
	}
}