import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		Map<String, Integer> m = new TreeMap<>();
		int max = 1;
		for(int i = 0; i < N; i++) {
			String S = sc.next();
			if(m.containsKey(S)) {
				m.put(S, m.get(S)+1);
				max = Math.max(max, m.get(S));
			}
			else
				m.put(S, 1);
		}
		List<String> l = new ArrayList<>();
		for(String s : m.keySet()) {
			if(m.get(s) == max)
				l.add(s);
		}
		Collections.sort(l);
		for(String s : l)
			System.out.println(s);

	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		Map<String, Integer> m = new TreeMap<>();
		int max = 1;
		for(int i = 0; i < N; i++) {
			String S = sc.next();
			if(m.containsKey(S)) {
				m.put(S, m.get(S)+1);
				max = Math.max(max, m.get(S));
			}
			else
				m.put(S, 1);
		}
		List<String> l = new ArrayList<>();
		for(String s : m.keySet()) {
			if(m.get(s) == max)
				l.add(s);
		}
		Collections.sort(l);
		for(String s : l)
			System.out.println(s);

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		Map<String, Integer> m = new TreeMap<>();
		int max = 1;
		for(int i = 0; i < N; i++) {
			String S = sc.next();
			if(m.containsKey(S)) {
				m.put(S, m.get(S)+1);
				max = Math.max(max, m.get(S));
			}
			else
				m.put(S, 1);
		}
		List<String> l = new ArrayList<>();
		for(String s : m.keySet()) {
			if(m.get(s) == max)
				l.add(s);
		}
		Collections.sort(l);
		for(String s : l)
			System.out.println(s);

	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		Map<String, Integer> m = new TreeMap<>();
		int max = 1;
		for(int i = 0; i < N; i++) {
			String S = sc.next();
			if(m.containsKey(S)) {
				m.put(S, m.get(S)+1);
				max = Math.max(max, m.get(S));
			}
			else
				m.put(S, 1);
		}
		List<String> l = new ArrayList<>();
		for(String s : m.keySet()) {
			if(m.get(s) == max)
				l.add(s);
		}
		Collections.sort(l);
		for(String s : l)
			System.out.println(s);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc Map<String, Integer> m = new TreeMap<>(); m new TreeMap<>() int max = 1; max 1 for(int i = 0; i < N; i++) {
			String S = sc.next();
			if(m.containsKey(S)) {
				m.put(S, m.get(S)+1);
				max = Math.max(max, m.get(S));
			}
			else
				m.put(S, 1);
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			String S = sc.next();
			if(m.containsKey(S)) {
				m.put(S, m.get(S)+1);
				max = Math.max(max, m.get(S));
			}
			else
				m.put(S, 1);
		} {
			String S = sc.next();
			if(m.containsKey(S)) {
				m.put(S, m.get(S)+1);
				max = Math.max(max, m.get(S));
			}
			else
				m.put(S, 1);
		} String S = sc.next(); S sc.next() sc.next sc if(m.containsKey(S)) {
				m.put(S, m.get(S)+1);
				max = Math.max(max, m.get(S));
			}
			else
				m.put(S, 1); m.containsKey(S) m.containsKey m S {
				m.put(S, m.get(S)+1);
				max = Math.max(max, m.get(S));
			} m.put(S, m.get(S)+1) m.put m S m.get(S)+1 m.get(S) m.get m S 1 max = Math.max(max, m.get(S)) max Math.max(max, m.get(S)) Math.max Math max m.get(S) m.get m S m.put(S, 1) m.put m S 1 List<String> l = new ArrayList<>(); l new ArrayList<>() for(String s : m.keySet()) {
			if(m.get(s) == max)
				l.add(s);
		} String s m.keySet() m.keySet m {
			if(m.get(s) == max)
				l.add(s);
		} {
			if(m.get(s) == max)
				l.add(s);
		} if(m.get(s) == max)
				l.add(s); m.get(s) == max m.get(s) m.get m s max l.add(s) l.add l s Collections.sort(l) Collections.sort Collections l for(String s : l)
			System.out.println(s); String s l System.out.println(s); System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		Map<String, Integer> m = new TreeMap<>();
		int max = 1;
		for(int i = 0; i < N; i++) {
			String S = sc.next();
			if(m.containsKey(S)) {
				m.put(S, m.get(S)+1);
				max = Math.max(max, m.get(S));
			}
			else
				m.put(S, 1);
		}
		List<String> l = new ArrayList<>();
		for(String s : m.keySet()) {
			if(m.get(s) == max)
				l.add(s);
		}
		Collections.sort(l);
		for(String s : l)
			System.out.println(s);

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		Map<String, Integer> m = new TreeMap<>();
		int max = 1;
		for(int i = 0; i < N; i++) {
			String S = sc.next();
			if(m.containsKey(S)) {
				m.put(S, m.get(S)+1);
				max = Math.max(max, m.get(S));
			}
			else
				m.put(S, 1);
		}
		List<String> l = new ArrayList<>();
		for(String s : m.keySet()) {
			if(m.get(s) == max)
				l.add(s);
		}
		Collections.sort(l);
		for(String s : l)
			System.out.println(s);

	}

} Main
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		Map<String, Integer> m = new TreeMap<>();
		int max = 1;
		for(int i = 0; i < N; i++) {
			String S = sc.next();
			if(m.containsKey(S)) {
				m.put(S, m.get(S)+1);
				max = Math.max(max, m.get(S));
			}
			else
				m.put(S, 1);
		}
		List<String> l = new ArrayList<>();
		for(String s : m.keySet()) {
			if(m.get(s) == max)
				l.add(s);
		}
		Collections.sort(l);
		for(String s : l)
			System.out.println(s);

	}

}