import java.util.*;
import java.math.*;
public class Main {
	static int[] color;
	static int[] component;
	static int component_count;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		Map<String, Integer> map = new TreeMap<>();
		int n = Integer.parseInt(in.next());
		for(int i = 0; i < n; i++) {
			String cur = in.next();
			if(map.containsKey(cur)) {
				int val = map.get(cur);
				map.put(cur, val + 1);
			}else map.put(cur, 1);
		}
		int cnt = 0;
		List<String> ans = new ArrayList<>();
		for(Map.Entry<String, Integer> entry : map.entrySet()) {
			if((int)entry.getValue() == cnt) {
				ans.add(entry.getKey());
			}else if((int)entry.getValue() > cnt) {
				cnt = entry.getValue();
				ans.clear();
				ans.add(entry.getKey());
			}
		}
		Collections.sort(ans);
		for(int i = 0; i < ans.size(); i++) {
			System.out.println(ans.get(i));
		}
	}
}  import java.util.*; util.* java import java.math.*; math.* java public class Main {
	static int[] color;
	static int[] component;
	static int component_count;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		Map<String, Integer> map = new TreeMap<>();
		int n = Integer.parseInt(in.next());
		for(int i = 0; i < n; i++) {
			String cur = in.next();
			if(map.containsKey(cur)) {
				int val = map.get(cur);
				map.put(cur, val + 1);
			}else map.put(cur, 1);
		}
		int cnt = 0;
		List<String> ans = new ArrayList<>();
		for(Map.Entry<String, Integer> entry : map.entrySet()) {
			if((int)entry.getValue() == cnt) {
				ans.add(entry.getKey());
			}else if((int)entry.getValue() > cnt) {
				cnt = entry.getValue();
				ans.clear();
				ans.add(entry.getKey());
			}
		}
		Collections.sort(ans);
		for(int i = 0; i < ans.size(); i++) {
			System.out.println(ans.get(i));
		}
	}
} Main static int[] color; color static int[] component; component static int component_count; component_count public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		Map<String, Integer> map = new TreeMap<>();
		int n = Integer.parseInt(in.next());
		for(int i = 0; i < n; i++) {
			String cur = in.next();
			if(map.containsKey(cur)) {
				int val = map.get(cur);
				map.put(cur, val + 1);
			}else map.put(cur, 1);
		}
		int cnt = 0;
		List<String> ans = new ArrayList<>();
		for(Map.Entry<String, Integer> entry : map.entrySet()) {
			if((int)entry.getValue() == cnt) {
				ans.add(entry.getKey());
			}else if((int)entry.getValue() > cnt) {
				cnt = entry.getValue();
				ans.clear();
				ans.add(entry.getKey());
			}
		}
		Collections.sort(ans);
		for(int i = 0; i < ans.size(); i++) {
			System.out.println(ans.get(i));
		}
	} main {
		Scanner in = new Scanner(System.in);
		Map<String, Integer> map = new TreeMap<>();
		int n = Integer.parseInt(in.next());
		for(int i = 0; i < n; i++) {
			String cur = in.next();
			if(map.containsKey(cur)) {
				int val = map.get(cur);
				map.put(cur, val + 1);
			}else map.put(cur, 1);
		}
		int cnt = 0;
		List<String> ans = new ArrayList<>();
		for(Map.Entry<String, Integer> entry : map.entrySet()) {
			if((int)entry.getValue() == cnt) {
				ans.add(entry.getKey());
			}else if((int)entry.getValue() > cnt) {
				cnt = entry.getValue();
				ans.clear();
				ans.add(entry.getKey());
			}
		}
		Collections.sort(ans);
		for(int i = 0; i < ans.size(); i++) {
			System.out.println(ans.get(i));
		}
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) Map<String, Integer> map = new TreeMap<>(); map new TreeMap<>() int n = Integer.parseInt(in.next()); n Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in for(int i = 0; i < n; i++) {
			String cur = in.next();
			if(map.containsKey(cur)) {
				int val = map.get(cur);
				map.put(cur, val + 1);
			}else map.put(cur, 1);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String cur = in.next();
			if(map.containsKey(cur)) {
				int val = map.get(cur);
				map.put(cur, val + 1);
			}else map.put(cur, 1);
		} {
			String cur = in.next();
			if(map.containsKey(cur)) {
				int val = map.get(cur);
				map.put(cur, val + 1);
			}else map.put(cur, 1);
		} String cur = in.next(); cur in.next() in.next in if(map.containsKey(cur)) {
				int val = map.get(cur);
				map.put(cur, val + 1);
			}else map.put(cur, 1); map.containsKey(cur) map.containsKey map cur {
				int val = map.get(cur);
				map.put(cur, val + 1);
			} int val = map.get(cur); val map.get(cur) map.get map cur map.put(cur, val + 1) map.put map cur val + 1 val 1 map.put(cur, 1) map.put map cur 1 int cnt = 0; cnt 0 List<String> ans = new ArrayList<>(); ans new ArrayList<>() for(Map.Entry<String, Integer> entry : map.entrySet()) {
			if((int)entry.getValue() == cnt) {
				ans.add(entry.getKey());
			}else if((int)entry.getValue() > cnt) {
				cnt = entry.getValue();
				ans.clear();
				ans.add(entry.getKey());
			}
		} Map.Entry<String, Integer> entry map.entrySet() map.entrySet map {
			if((int)entry.getValue() == cnt) {
				ans.add(entry.getKey());
			}else if((int)entry.getValue() > cnt) {
				cnt = entry.getValue();
				ans.clear();
				ans.add(entry.getKey());
			}
		} {
			if((int)entry.getValue() == cnt) {
				ans.add(entry.getKey());
			}else if((int)entry.getValue() > cnt) {
				cnt = entry.getValue();
				ans.clear();
				ans.add(entry.getKey());
			}
		} if((int)entry.getValue() == cnt) {
				ans.add(entry.getKey());
			}else if((int)entry.getValue() > cnt) {
				cnt = entry.getValue();
				ans.clear();
				ans.add(entry.getKey());
			} (int)entry.getValue() == cnt (int)entry.getValue() entry.getValue entry cnt {
				ans.add(entry.getKey());
			} ans.add(entry.getKey()) ans.add ans entry.getKey() entry.getKey entry if((int)entry.getValue() > cnt) {
				cnt = entry.getValue();
				ans.clear();
				ans.add(entry.getKey());
			} (int)entry.getValue() > cnt (int)entry.getValue() entry.getValue entry cnt {
				cnt = entry.getValue();
				ans.clear();
				ans.add(entry.getKey());
			} cnt = entry.getValue() cnt entry.getValue() entry.getValue entry ans.clear() ans.clear ans ans.add(entry.getKey()) ans.add ans entry.getKey() entry.getKey entry Collections.sort(ans) Collections.sort Collections ans for(int i = 0; i < ans.size(); i++) {
			System.out.println(ans.get(i));
		} int i = 0; int i = 0; i 0 i < ans.size() i ans.size() ans.size ans i++ i++ i {
			System.out.println(ans.get(i));
		} {
			System.out.println(ans.get(i));
		} System.out.println(ans.get(i)) System.out.println System.out System System.out ans.get(i) ans.get ans i String[] args args public class Main {
	static int[] color;
	static int[] component;
	static int component_count;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		Map<String, Integer> map = new TreeMap<>();
		int n = Integer.parseInt(in.next());
		for(int i = 0; i < n; i++) {
			String cur = in.next();
			if(map.containsKey(cur)) {
				int val = map.get(cur);
				map.put(cur, val + 1);
			}else map.put(cur, 1);
		}
		int cnt = 0;
		List<String> ans = new ArrayList<>();
		for(Map.Entry<String, Integer> entry : map.entrySet()) {
			if((int)entry.getValue() == cnt) {
				ans.add(entry.getKey());
			}else if((int)entry.getValue() > cnt) {
				cnt = entry.getValue();
				ans.clear();
				ans.add(entry.getKey());
			}
		}
		Collections.sort(ans);
		for(int i = 0; i < ans.size(); i++) {
			System.out.println(ans.get(i));
		}
	}
} public class Main {
	static int[] color;
	static int[] component;
	static int component_count;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		Map<String, Integer> map = new TreeMap<>();
		int n = Integer.parseInt(in.next());
		for(int i = 0; i < n; i++) {
			String cur = in.next();
			if(map.containsKey(cur)) {
				int val = map.get(cur);
				map.put(cur, val + 1);
			}else map.put(cur, 1);
		}
		int cnt = 0;
		List<String> ans = new ArrayList<>();
		for(Map.Entry<String, Integer> entry : map.entrySet()) {
			if((int)entry.getValue() == cnt) {
				ans.add(entry.getKey());
			}else if((int)entry.getValue() > cnt) {
				cnt = entry.getValue();
				ans.clear();
				ans.add(entry.getKey());
			}
		}
		Collections.sort(ans);
		for(int i = 0; i < ans.size(); i++) {
			System.out.println(ans.get(i));
		}
	}
} Main
import java.util.*;
import java.math.*;
public class Main {
	static int[] color;
	static int[] component;
	static int component_count;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		Map<String, Integer> map = new TreeMap<>();
		int n = Integer.parseInt(in.next());
		for(int i = 0; i < n; i++) {
			String cur = in.next();
			if(map.containsKey(cur)) {
				int val = map.get(cur);
				map.put(cur, val + 1);
			}else map.put(cur, 1);
		}
		int cnt = 0;
		List<String> ans = new ArrayList<>();
		for(Map.Entry<String, Integer> entry : map.entrySet()) {
			if((int)entry.getValue() == cnt) {
				ans.add(entry.getKey());
			}else if((int)entry.getValue() > cnt) {
				cnt = entry.getValue();
				ans.clear();
				ans.add(entry.getKey());
			}
		}
		Collections.sort(ans);
		for(int i = 0; i < ans.size(); i++) {
			System.out.println(ans.get(i));
		}
	}
} 
