import java.util.Scanner;
import java.util.TreeMap;

class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		TreeMap<String, Integer> treeMap = new TreeMap<String, Integer>();
		for (int i = 0; i < N; i++) {
			String s = scanner.next();
			if (!treeMap.containsKey(s))
				treeMap.put(s, 1);
			else
				treeMap.put(s, treeMap.get(s) + 1);
		}

		int max = 0;
		for (String key : treeMap.keySet()) {
			if (max < treeMap.get(key))
				max = treeMap.get(key);
		}

		for (String key : treeMap.keySet())
			if (treeMap.get(key) == max)
				System.out.println(key);
	}
} import java.util.Scanner; Scanner java.util import java.util.TreeMap; TreeMap java.util class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		TreeMap<String, Integer> treeMap = new TreeMap<String, Integer>();
		for (int i = 0; i < N; i++) {
			String s = scanner.next();
			if (!treeMap.containsKey(s))
				treeMap.put(s, 1);
			else
				treeMap.put(s, treeMap.get(s) + 1);
		}

		int max = 0;
		for (String key : treeMap.keySet()) {
			if (max < treeMap.get(key))
				max = treeMap.get(key);
		}

		for (String key : treeMap.keySet())
			if (treeMap.get(key) == max)
				System.out.println(key);
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		TreeMap<String, Integer> treeMap = new TreeMap<String, Integer>();
		for (int i = 0; i < N; i++) {
			String s = scanner.next();
			if (!treeMap.containsKey(s))
				treeMap.put(s, 1);
			else
				treeMap.put(s, treeMap.get(s) + 1);
		}

		int max = 0;
		for (String key : treeMap.keySet()) {
			if (max < treeMap.get(key))
				max = treeMap.get(key);
		}

		for (String key : treeMap.keySet())
			if (treeMap.get(key) == max)
				System.out.println(key);
	} main {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		TreeMap<String, Integer> treeMap = new TreeMap<String, Integer>();
		for (int i = 0; i < N; i++) {
			String s = scanner.next();
			if (!treeMap.containsKey(s))
				treeMap.put(s, 1);
			else
				treeMap.put(s, treeMap.get(s) + 1);
		}

		int max = 0;
		for (String key : treeMap.keySet()) {
			if (max < treeMap.get(key))
				max = treeMap.get(key);
		}

		for (String key : treeMap.keySet())
			if (treeMap.get(key) == max)
				System.out.println(key);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner TreeMap<String, Integer> treeMap = new TreeMap<String, Integer>(); treeMap new TreeMap<String, Integer>() for (int i = 0; i < N; i++) {
			String s = scanner.next();
			if (!treeMap.containsKey(s))
				treeMap.put(s, 1);
			else
				treeMap.put(s, treeMap.get(s) + 1);
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			String s = scanner.next();
			if (!treeMap.containsKey(s))
				treeMap.put(s, 1);
			else
				treeMap.put(s, treeMap.get(s) + 1);
		} {
			String s = scanner.next();
			if (!treeMap.containsKey(s))
				treeMap.put(s, 1);
			else
				treeMap.put(s, treeMap.get(s) + 1);
		} String s = scanner.next(); s scanner.next() scanner.next scanner if (!treeMap.containsKey(s))
				treeMap.put(s, 1);
			else
				treeMap.put(s, treeMap.get(s) + 1); !treeMap.containsKey(s) treeMap.containsKey(s) treeMap.containsKey treeMap s treeMap.put(s, 1) treeMap.put treeMap s 1 treeMap.put(s, treeMap.get(s) + 1) treeMap.put treeMap s treeMap.get(s) + 1 treeMap.get(s) treeMap.get treeMap s 1 int max = 0; max 0 for (String key : treeMap.keySet()) {
			if (max < treeMap.get(key))
				max = treeMap.get(key);
		} String key treeMap.keySet() treeMap.keySet treeMap {
			if (max < treeMap.get(key))
				max = treeMap.get(key);
		} {
			if (max < treeMap.get(key))
				max = treeMap.get(key);
		} if (max < treeMap.get(key))
				max = treeMap.get(key); max < treeMap.get(key) max treeMap.get(key) treeMap.get treeMap key max = treeMap.get(key) max treeMap.get(key) treeMap.get treeMap key for (String key : treeMap.keySet())
			if (treeMap.get(key) == max)
				System.out.println(key); String key treeMap.keySet() treeMap.keySet treeMap if (treeMap.get(key) == max)
				System.out.println(key); if (treeMap.get(key) == max)
				System.out.println(key); treeMap.get(key) == max treeMap.get(key) treeMap.get treeMap key max System.out.println(key) System.out.println System.out System System.out key String[] args args
import java.util.Scanner;
import java.util.TreeMap;

class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		TreeMap<String, Integer> treeMap = new TreeMap<String, Integer>();
		for (int i = 0; i < N; i++) {
			String s = scanner.next();
			if (!treeMap.containsKey(s))
				treeMap.put(s, 1);
			else
				treeMap.put(s, treeMap.get(s) + 1);
		}

		int max = 0;
		for (String key : treeMap.keySet()) {
			if (max < treeMap.get(key))
				max = treeMap.get(key);
		}

		for (String key : treeMap.keySet())
			if (treeMap.get(key) == max)
				System.out.println(key);
	}
}