import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		Set<String> set = new HashSet<>();
		Map<String, Integer> map = new HashMap<>();
		String[] s = new String[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.next();
			set.add(s[i]);
			map.put(s[i], 0);
		}

		for (int i = 0; i < n; i++) {
			int v = map.get(s[i]);
			map.put(s[i], ++v);
		}

		int max = 1;
		for (String key : map.keySet()) {
			if (map.get(key) > max) {
				max = map.get(key);
			}
		}

		Set<String> tSet = new TreeSet<>();
		for (String key : map.keySet()) {
			if (map.get(key) == max) {
				tSet.add(key);
			}
		}

		StringBuilder sb = new StringBuilder();
		for (String string : tSet) {
			sb.append(string);
			sb.append('\n');
		}

		System.out.println(sb.toString());
	}


} import java.util.HashMap; HashMap java.util import java.util.HashSet; HashSet java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util import java.util.TreeSet; TreeSet java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		Set<String> set = new HashSet<>();
		Map<String, Integer> map = new HashMap<>();
		String[] s = new String[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.next();
			set.add(s[i]);
			map.put(s[i], 0);
		}

		for (int i = 0; i < n; i++) {
			int v = map.get(s[i]);
			map.put(s[i], ++v);
		}

		int max = 1;
		for (String key : map.keySet()) {
			if (map.get(key) > max) {
				max = map.get(key);
			}
		}

		Set<String> tSet = new TreeSet<>();
		for (String key : map.keySet()) {
			if (map.get(key) == max) {
				tSet.add(key);
			}
		}

		StringBuilder sb = new StringBuilder();
		for (String string : tSet) {
			sb.append(string);
			sb.append('\n');
		}

		System.out.println(sb.toString());
	}


} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		Set<String> set = new HashSet<>();
		Map<String, Integer> map = new HashMap<>();
		String[] s = new String[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.next();
			set.add(s[i]);
			map.put(s[i], 0);
		}

		for (int i = 0; i < n; i++) {
			int v = map.get(s[i]);
			map.put(s[i], ++v);
		}

		int max = 1;
		for (String key : map.keySet()) {
			if (map.get(key) > max) {
				max = map.get(key);
			}
		}

		Set<String> tSet = new TreeSet<>();
		for (String key : map.keySet()) {
			if (map.get(key) == max) {
				tSet.add(key);
			}
		}

		StringBuilder sb = new StringBuilder();
		for (String string : tSet) {
			sb.append(string);
			sb.append('\n');
		}

		System.out.println(sb.toString());
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		Set<String> set = new HashSet<>();
		Map<String, Integer> map = new HashMap<>();
		String[] s = new String[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.next();
			set.add(s[i]);
			map.put(s[i], 0);
		}

		for (int i = 0; i < n; i++) {
			int v = map.get(s[i]);
			map.put(s[i], ++v);
		}

		int max = 1;
		for (String key : map.keySet()) {
			if (map.get(key) > max) {
				max = map.get(key);
			}
		}

		Set<String> tSet = new TreeSet<>();
		for (String key : map.keySet()) {
			if (map.get(key) == max) {
				tSet.add(key);
			}
		}

		StringBuilder sb = new StringBuilder();
		for (String string : tSet) {
			sb.append(string);
			sb.append('\n');
		}

		System.out.println(sb.toString());
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Set<String> set = new HashSet<>(); set new HashSet<>() Map<String, Integer> map = new HashMap<>(); map new HashMap<>() String[] s = new String[n]; s new String[n] n for (int i = 0; i < n; i++) {
			s[i] = sc.next();
			set.add(s[i]);
			map.put(s[i], 0);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			s[i] = sc.next();
			set.add(s[i]);
			map.put(s[i], 0);
		} {
			s[i] = sc.next();
			set.add(s[i]);
			map.put(s[i], 0);
		} s[i] = sc.next() s[i] s i sc.next() sc.next sc set.add(s[i]) set.add set s[i] s i map.put(s[i], 0) map.put map s[i] s i 0 for (int i = 0; i < n; i++) {
			int v = map.get(s[i]);
			map.put(s[i], ++v);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int v = map.get(s[i]);
			map.put(s[i], ++v);
		} {
			int v = map.get(s[i]);
			map.put(s[i], ++v);
		} int v = map.get(s[i]); v map.get(s[i]) map.get map s[i] s i map.put(s[i], ++v) map.put map s[i] s i ++v v int max = 1; max 1 for (String key : map.keySet()) {
			if (map.get(key) > max) {
				max = map.get(key);
			}
		} String key map.keySet() map.keySet map {
			if (map.get(key) > max) {
				max = map.get(key);
			}
		} {
			if (map.get(key) > max) {
				max = map.get(key);
			}
		} if (map.get(key) > max) {
				max = map.get(key);
			} map.get(key) > max map.get(key) map.get map key max {
				max = map.get(key);
			} max = map.get(key) max map.get(key) map.get map key Set<String> tSet = new TreeSet<>(); tSet new TreeSet<>() for (String key : map.keySet()) {
			if (map.get(key) == max) {
				tSet.add(key);
			}
		} String key map.keySet() map.keySet map {
			if (map.get(key) == max) {
				tSet.add(key);
			}
		} {
			if (map.get(key) == max) {
				tSet.add(key);
			}
		} if (map.get(key) == max) {
				tSet.add(key);
			} map.get(key) == max map.get(key) map.get map key max {
				tSet.add(key);
			} tSet.add(key) tSet.add tSet key StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (String string : tSet) {
			sb.append(string);
			sb.append('\n');
		} String string tSet {
			sb.append(string);
			sb.append('\n');
		} {
			sb.append(string);
			sb.append('\n');
		} sb.append(string) sb.append sb string sb.append('\n') sb.append sb '\n' System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		Set<String> set = new HashSet<>();
		Map<String, Integer> map = new HashMap<>();
		String[] s = new String[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.next();
			set.add(s[i]);
			map.put(s[i], 0);
		}

		for (int i = 0; i < n; i++) {
			int v = map.get(s[i]);
			map.put(s[i], ++v);
		}

		int max = 1;
		for (String key : map.keySet()) {
			if (map.get(key) > max) {
				max = map.get(key);
			}
		}

		Set<String> tSet = new TreeSet<>();
		for (String key : map.keySet()) {
			if (map.get(key) == max) {
				tSet.add(key);
			}
		}

		StringBuilder sb = new StringBuilder();
		for (String string : tSet) {
			sb.append(string);
			sb.append('\n');
		}

		System.out.println(sb.toString());
	}


} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		Set<String> set = new HashSet<>();
		Map<String, Integer> map = new HashMap<>();
		String[] s = new String[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.next();
			set.add(s[i]);
			map.put(s[i], 0);
		}

		for (int i = 0; i < n; i++) {
			int v = map.get(s[i]);
			map.put(s[i], ++v);
		}

		int max = 1;
		for (String key : map.keySet()) {
			if (map.get(key) > max) {
				max = map.get(key);
			}
		}

		Set<String> tSet = new TreeSet<>();
		for (String key : map.keySet()) {
			if (map.get(key) == max) {
				tSet.add(key);
			}
		}

		StringBuilder sb = new StringBuilder();
		for (String string : tSet) {
			sb.append(string);
			sb.append('\n');
		}

		System.out.println(sb.toString());
	}


} Main
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		Set<String> set = new HashSet<>();
		Map<String, Integer> map = new HashMap<>();
		String[] s = new String[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.next();
			set.add(s[i]);
			map.put(s[i], 0);
		}

		for (int i = 0; i < n; i++) {
			int v = map.get(s[i]);
			map.put(s[i], ++v);
		}

		int max = 1;
		for (String key : map.keySet()) {
			if (map.get(key) > max) {
				max = map.get(key);
			}
		}

		Set<String> tSet = new TreeSet<>();
		for (String key : map.keySet()) {
			if (map.get(key) == max) {
				tSet.add(key);
			}
		}

		StringBuilder sb = new StringBuilder();
		for (String string : tSet) {
			sb.append(string);
			sb.append('\n');
		}

		System.out.println(sb.toString());
	}


}
