import java.util.*;
import java.util.Map.Entry;
import java.util.stream.Collectors;

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

		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}
		sc.close();

		int maxDup = 1;
		Map<String, Integer> m = new HashMap<String, Integer>();

		for (String s: S) {
			int v;
			if (m.containsKey(s)) {
				// Mapに登録済み
				v = m.get(s) + 1;
				if (v > maxDup) {
					maxDup = v;
				}
			} else {
				// Mapに未登録
				v = 1;
			}
			m.put(s, v);
		}

		ArrayList<String> list = new ArrayList<String>();
		for (Entry<String, Integer> entry : m.entrySet()) {
			if (entry.getValue() == maxDup) {
				list.add(entry.getKey());
			}
		}
		Collections.sort(list);
		for (String s: list) {
			System.out.println(s);
		}
	}
} import java.util.*; util.* java import java.util.Map.Entry; Entry java.util.Map import java.util.stream.Collectors; Collectors java.util.stream public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}
		sc.close();

		int maxDup = 1;
		Map<String, Integer> m = new HashMap<String, Integer>();

		for (String s: S) {
			int v;
			if (m.containsKey(s)) {
				// Mapに登録済み
				v = m.get(s) + 1;
				if (v > maxDup) {
					maxDup = v;
				}
			} else {
				// Mapに未登録
				v = 1;
			}
			m.put(s, v);
		}

		ArrayList<String> list = new ArrayList<String>();
		for (Entry<String, Integer> entry : m.entrySet()) {
			if (entry.getValue() == maxDup) {
				list.add(entry.getKey());
			}
		}
		Collections.sort(list);
		for (String s: list) {
			System.out.println(s);
		}
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}
		sc.close();

		int maxDup = 1;
		Map<String, Integer> m = new HashMap<String, Integer>();

		for (String s: S) {
			int v;
			if (m.containsKey(s)) {
				// Mapに登録済み
				v = m.get(s) + 1;
				if (v > maxDup) {
					maxDup = v;
				}
			} else {
				// Mapに未登録
				v = 1;
			}
			m.put(s, v);
		}

		ArrayList<String> list = new ArrayList<String>();
		for (Entry<String, Integer> entry : m.entrySet()) {
			if (entry.getValue() == maxDup) {
				list.add(entry.getKey());
			}
		}
		Collections.sort(list);
		for (String s: list) {
			System.out.println(s);
		}
	} main {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}
		sc.close();

		int maxDup = 1;
		Map<String, Integer> m = new HashMap<String, Integer>();

		for (String s: S) {
			int v;
			if (m.containsKey(s)) {
				// Mapに登録済み
				v = m.get(s) + 1;
				if (v > maxDup) {
					maxDup = v;
				}
			} else {
				// Mapに未登録
				v = 1;
			}
			m.put(s, v);
		}

		ArrayList<String> list = new ArrayList<String>();
		for (Entry<String, Integer> entry : m.entrySet()) {
			if (entry.getValue() == maxDup) {
				list.add(entry.getKey());
			}
		}
		Collections.sort(list);
		for (String s: list) {
			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 String[] S = new String[N]; S new String[N] N for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			S[i] = sc.next();
		} {
			S[i] = sc.next();
		} S[i] = sc.next() S[i] S i sc.next() sc.next sc sc.close() sc.close sc int maxDup = 1; maxDup 1 Map<String, Integer> m = new HashMap<String, Integer>(); m new HashMap<String, Integer>() for (String s: S) {
			int v;
			if (m.containsKey(s)) {
				// Mapに登録済み
				v = m.get(s) + 1;
				if (v > maxDup) {
					maxDup = v;
				}
			} else {
				// Mapに未登録
				v = 1;
			}
			m.put(s, v);
		} String s S {
			int v;
			if (m.containsKey(s)) {
				// Mapに登録済み
				v = m.get(s) + 1;
				if (v > maxDup) {
					maxDup = v;
				}
			} else {
				// Mapに未登録
				v = 1;
			}
			m.put(s, v);
		} {
			int v;
			if (m.containsKey(s)) {
				// Mapに登録済み
				v = m.get(s) + 1;
				if (v > maxDup) {
					maxDup = v;
				}
			} else {
				// Mapに未登録
				v = 1;
			}
			m.put(s, v);
		} int v; v if (m.containsKey(s)) {
				// Mapに登録済み
				v = m.get(s) + 1;
				if (v > maxDup) {
					maxDup = v;
				}
			} else {
				// Mapに未登録
				v = 1;
			} m.containsKey(s) m.containsKey m s {
				// Mapに登録済み
				v = m.get(s) + 1;
				if (v > maxDup) {
					maxDup = v;
				}
			} v = m.get(s) + 1 v m.get(s) + 1 m.get(s) m.get m s 1 if (v > maxDup) {
					maxDup = v;
				} v > maxDup v maxDup {
					maxDup = v;
				} maxDup = v maxDup v {
				// Mapに未登録
				v = 1;
			} v = 1 v 1 m.put(s, v) m.put m s v ArrayList<String> list = new ArrayList<String>(); list new ArrayList<String>() for (Entry<String, Integer> entry : m.entrySet()) {
			if (entry.getValue() == maxDup) {
				list.add(entry.getKey());
			}
		} Entry<String, Integer> entry m.entrySet() m.entrySet m {
			if (entry.getValue() == maxDup) {
				list.add(entry.getKey());
			}
		} {
			if (entry.getValue() == maxDup) {
				list.add(entry.getKey());
			}
		} if (entry.getValue() == maxDup) {
				list.add(entry.getKey());
			} entry.getValue() == maxDup entry.getValue() entry.getValue entry maxDup {
				list.add(entry.getKey());
			} list.add(entry.getKey()) list.add list entry.getKey() entry.getKey entry Collections.sort(list) Collections.sort Collections list for (String s: list) {
			System.out.println(s);
		} String s list {
			System.out.println(s);
		} {
			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();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}
		sc.close();

		int maxDup = 1;
		Map<String, Integer> m = new HashMap<String, Integer>();

		for (String s: S) {
			int v;
			if (m.containsKey(s)) {
				// Mapに登録済み
				v = m.get(s) + 1;
				if (v > maxDup) {
					maxDup = v;
				}
			} else {
				// Mapに未登録
				v = 1;
			}
			m.put(s, v);
		}

		ArrayList<String> list = new ArrayList<String>();
		for (Entry<String, Integer> entry : m.entrySet()) {
			if (entry.getValue() == maxDup) {
				list.add(entry.getKey());
			}
		}
		Collections.sort(list);
		for (String s: list) {
			System.out.println(s);
		}
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}
		sc.close();

		int maxDup = 1;
		Map<String, Integer> m = new HashMap<String, Integer>();

		for (String s: S) {
			int v;
			if (m.containsKey(s)) {
				// Mapに登録済み
				v = m.get(s) + 1;
				if (v > maxDup) {
					maxDup = v;
				}
			} else {
				// Mapに未登録
				v = 1;
			}
			m.put(s, v);
		}

		ArrayList<String> list = new ArrayList<String>();
		for (Entry<String, Integer> entry : m.entrySet()) {
			if (entry.getValue() == maxDup) {
				list.add(entry.getKey());
			}
		}
		Collections.sort(list);
		for (String s: list) {
			System.out.println(s);
		}
	}
} Main
import java.util.*;
import java.util.Map.Entry;
import java.util.stream.Collectors;

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

		int N = sc.nextInt();
		String[] S = new String[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
		}
		sc.close();

		int maxDup = 1;
		Map<String, Integer> m = new HashMap<String, Integer>();

		for (String s: S) {
			int v;
			if (m.containsKey(s)) {
				// Mapに登録済み
				v = m.get(s) + 1;
				if (v > maxDup) {
					maxDup = v;
				}
			} else {
				// Mapに未登録
				v = 1;
			}
			m.put(s, v);
		}

		ArrayList<String> list = new ArrayList<String>();
		for (Entry<String, Integer> entry : m.entrySet()) {
			if (entry.getValue() == maxDup) {
				list.add(entry.getKey());
			}
		}
		Collections.sort(list);
		for (String s: list) {
			System.out.println(s);
		}
	}
}
