import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); int max = 1, rem = 0;
		Map<String, Integer> map = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else map.put(s, 1);
		}
		List<String> list = new ArrayList<String>();
		for(String key : map.keySet()) if(map.get(key) == max) list.add(key);
		Collections.sort(list);
		StringBuilder sb = new StringBuilder();
		for(String key : list) sb.append(key+"\n");
		System.out.println(new String(sb));
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); int max = 1, rem = 0;
		Map<String, Integer> map = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else map.put(s, 1);
		}
		List<String> list = new ArrayList<String>();
		for(String key : map.keySet()) if(map.get(key) == max) list.add(key);
		Collections.sort(list);
		StringBuilder sb = new StringBuilder();
		for(String key : list) sb.append(key+"\n");
		System.out.println(new String(sb));
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); int max = 1, rem = 0;
		Map<String, Integer> map = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else map.put(s, 1);
		}
		List<String> list = new ArrayList<String>();
		for(String key : map.keySet()) if(map.get(key) == max) list.add(key);
		Collections.sort(list);
		StringBuilder sb = new StringBuilder();
		for(String key : list) sb.append(key+"\n");
		System.out.println(new String(sb));
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); int max = 1, rem = 0;
		Map<String, Integer> map = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else map.put(s, 1);
		}
		List<String> list = new ArrayList<String>();
		for(String key : map.keySet()) if(map.get(key) == max) list.add(key);
		Collections.sort(list);
		StringBuilder sb = new StringBuilder();
		for(String key : list) sb.append(key+"\n");
		System.out.println(new String(sb));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int max = 1 max 1 rem = 0; rem 0 Map<String, Integer> map = new HashMap<String, Integer>(); map new HashMap<String, Integer>() for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else map.put(s, 1);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else map.put(s, 1);
		} {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else map.put(s, 1);
		} String s = sc.next(); s sc.next() sc.next sc if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else map.put(s, 1); map.containsKey(s) map.containsKey map s {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			} rem = map.get(s)+1 rem map.get(s)+1 map.get(s) map.get map s 1 map.replace(s, rem) map.replace map s rem max = Math.max(max,rem) max Math.max(max,rem) Math.max Math max rem map.put(s, 1) map.put map s 1 List<String> list = new ArrayList<String>(); list new ArrayList<String>() for(String key : map.keySet()) if(map.get(key) == max) list.add(key); String key map.keySet() map.keySet map if(map.get(key) == max) list.add(key); if(map.get(key) == max) list.add(key); map.get(key) == max map.get(key) map.get map key max list.add(key) list.add list key Collections.sort(list) Collections.sort Collections list StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(String key : list) sb.append(key+"\n"); String key list sb.append(key+"\n"); sb.append(key+"\n") sb.append sb key+"\n" key "\n" System.out.println(new String(sb)) System.out.println System.out System System.out new String(sb) String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); int max = 1, rem = 0;
		Map<String, Integer> map = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else map.put(s, 1);
		}
		List<String> list = new ArrayList<String>();
		for(String key : map.keySet()) if(map.get(key) == max) list.add(key);
		Collections.sort(list);
		StringBuilder sb = new StringBuilder();
		for(String key : list) sb.append(key+"\n");
		System.out.println(new String(sb));
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); int max = 1, rem = 0;
		Map<String, Integer> map = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else map.put(s, 1);
		}
		List<String> list = new ArrayList<String>();
		for(String key : map.keySet()) if(map.get(key) == max) list.add(key);
		Collections.sort(list);
		StringBuilder sb = new StringBuilder();
		for(String key : list) sb.append(key+"\n");
		System.out.println(new String(sb));
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); int max = 1, rem = 0;
		Map<String, Integer> map = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else map.put(s, 1);
		}
		List<String> list = new ArrayList<String>();
		for(String key : map.keySet()) if(map.get(key) == max) list.add(key);
		Collections.sort(list);
		StringBuilder sb = new StringBuilder();
		for(String key : list) sb.append(key+"\n");
		System.out.println(new String(sb));
	}
}
