import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

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();

		HashMap<String, Integer> map = new HashMap<>();
		int cntmax = 0;
		for ( String s : S ) {
			if ( map.containsKey(s) ) {
				int cnt = map.get(s) + 1;
				map.put(s, cnt);
				cntmax = Math.max(cnt, cntmax);
			} else {
				map.put(s, 1);
				cntmax = Math.max(1, cntmax);
			}
		}

		ArrayList<String> list = new ArrayList<>();
		for (String s : map.keySet()) {
			if ( map.get(s) == cntmax ) {
				list.add(s);
			}
		}
		String[] ans = list.toArray(new String[list.size()]);
		Arrays.sort(ans);

		StringBuilder ret = new StringBuilder();
		for ( String s : ans ) {
			ret.append(s);
			ret.append("\n");
		}
		System.out.println(ret.toString());
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.Scanner; Scanner java.util 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();

		HashMap<String, Integer> map = new HashMap<>();
		int cntmax = 0;
		for ( String s : S ) {
			if ( map.containsKey(s) ) {
				int cnt = map.get(s) + 1;
				map.put(s, cnt);
				cntmax = Math.max(cnt, cntmax);
			} else {
				map.put(s, 1);
				cntmax = Math.max(1, cntmax);
			}
		}

		ArrayList<String> list = new ArrayList<>();
		for (String s : map.keySet()) {
			if ( map.get(s) == cntmax ) {
				list.add(s);
			}
		}
		String[] ans = list.toArray(new String[list.size()]);
		Arrays.sort(ans);

		StringBuilder ret = new StringBuilder();
		for ( String s : ans ) {
			ret.append(s);
			ret.append("\n");
		}
		System.out.println(ret.toString());
	}
} 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();

		HashMap<String, Integer> map = new HashMap<>();
		int cntmax = 0;
		for ( String s : S ) {
			if ( map.containsKey(s) ) {
				int cnt = map.get(s) + 1;
				map.put(s, cnt);
				cntmax = Math.max(cnt, cntmax);
			} else {
				map.put(s, 1);
				cntmax = Math.max(1, cntmax);
			}
		}

		ArrayList<String> list = new ArrayList<>();
		for (String s : map.keySet()) {
			if ( map.get(s) == cntmax ) {
				list.add(s);
			}
		}
		String[] ans = list.toArray(new String[list.size()]);
		Arrays.sort(ans);

		StringBuilder ret = new StringBuilder();
		for ( String s : ans ) {
			ret.append(s);
			ret.append("\n");
		}
		System.out.println(ret.toString());
	} 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();

		HashMap<String, Integer> map = new HashMap<>();
		int cntmax = 0;
		for ( String s : S ) {
			if ( map.containsKey(s) ) {
				int cnt = map.get(s) + 1;
				map.put(s, cnt);
				cntmax = Math.max(cnt, cntmax);
			} else {
				map.put(s, 1);
				cntmax = Math.max(1, cntmax);
			}
		}

		ArrayList<String> list = new ArrayList<>();
		for (String s : map.keySet()) {
			if ( map.get(s) == cntmax ) {
				list.add(s);
			}
		}
		String[] ans = list.toArray(new String[list.size()]);
		Arrays.sort(ans);

		StringBuilder ret = new StringBuilder();
		for ( String s : ans ) {
			ret.append(s);
			ret.append("\n");
		}
		System.out.println(ret.toString());
	} 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 HashMap<String, Integer> map = new HashMap<>(); map new HashMap<>() int cntmax = 0; cntmax 0 for ( String s : S ) {
			if ( map.containsKey(s) ) {
				int cnt = map.get(s) + 1;
				map.put(s, cnt);
				cntmax = Math.max(cnt, cntmax);
			} else {
				map.put(s, 1);
				cntmax = Math.max(1, cntmax);
			}
		} String s S {
			if ( map.containsKey(s) ) {
				int cnt = map.get(s) + 1;
				map.put(s, cnt);
				cntmax = Math.max(cnt, cntmax);
			} else {
				map.put(s, 1);
				cntmax = Math.max(1, cntmax);
			}
		} {
			if ( map.containsKey(s) ) {
				int cnt = map.get(s) + 1;
				map.put(s, cnt);
				cntmax = Math.max(cnt, cntmax);
			} else {
				map.put(s, 1);
				cntmax = Math.max(1, cntmax);
			}
		} if ( map.containsKey(s) ) {
				int cnt = map.get(s) + 1;
				map.put(s, cnt);
				cntmax = Math.max(cnt, cntmax);
			} else {
				map.put(s, 1);
				cntmax = Math.max(1, cntmax);
			} map.containsKey(s) map.containsKey map s {
				int cnt = map.get(s) + 1;
				map.put(s, cnt);
				cntmax = Math.max(cnt, cntmax);
			} int cnt = map.get(s) + 1; cnt map.get(s) + 1 map.get(s) map.get map s 1 map.put(s, cnt) map.put map s cnt cntmax = Math.max(cnt, cntmax) cntmax Math.max(cnt, cntmax) Math.max Math cnt cntmax {
				map.put(s, 1);
				cntmax = Math.max(1, cntmax);
			} map.put(s, 1) map.put map s 1 cntmax = Math.max(1, cntmax) cntmax Math.max(1, cntmax) Math.max Math 1 cntmax ArrayList<String> list = new ArrayList<>(); list new ArrayList<>() for (String s : map.keySet()) {
			if ( map.get(s) == cntmax ) {
				list.add(s);
			}
		} String s map.keySet() map.keySet map {
			if ( map.get(s) == cntmax ) {
				list.add(s);
			}
		} {
			if ( map.get(s) == cntmax ) {
				list.add(s);
			}
		} if ( map.get(s) == cntmax ) {
				list.add(s);
			} map.get(s) == cntmax map.get(s) map.get map s cntmax {
				list.add(s);
			} list.add(s) list.add list s String[] ans = list.toArray(new String[list.size()]); ans list.toArray(new String[list.size()]) list.toArray list new String[list.size()] list.size() list.size list Arrays.sort(ans) Arrays.sort Arrays ans StringBuilder ret = new StringBuilder(); ret new StringBuilder() for ( String s : ans ) {
			ret.append(s);
			ret.append("\n");
		} String s ans {
			ret.append(s);
			ret.append("\n");
		} {
			ret.append(s);
			ret.append("\n");
		} ret.append(s) ret.append ret s ret.append("\n") ret.append ret "\n" System.out.println(ret.toString()) System.out.println System.out System System.out ret.toString() ret.toString ret 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();

		HashMap<String, Integer> map = new HashMap<>();
		int cntmax = 0;
		for ( String s : S ) {
			if ( map.containsKey(s) ) {
				int cnt = map.get(s) + 1;
				map.put(s, cnt);
				cntmax = Math.max(cnt, cntmax);
			} else {
				map.put(s, 1);
				cntmax = Math.max(1, cntmax);
			}
		}

		ArrayList<String> list = new ArrayList<>();
		for (String s : map.keySet()) {
			if ( map.get(s) == cntmax ) {
				list.add(s);
			}
		}
		String[] ans = list.toArray(new String[list.size()]);
		Arrays.sort(ans);

		StringBuilder ret = new StringBuilder();
		for ( String s : ans ) {
			ret.append(s);
			ret.append("\n");
		}
		System.out.println(ret.toString());
	}
} 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();

		HashMap<String, Integer> map = new HashMap<>();
		int cntmax = 0;
		for ( String s : S ) {
			if ( map.containsKey(s) ) {
				int cnt = map.get(s) + 1;
				map.put(s, cnt);
				cntmax = Math.max(cnt, cntmax);
			} else {
				map.put(s, 1);
				cntmax = Math.max(1, cntmax);
			}
		}

		ArrayList<String> list = new ArrayList<>();
		for (String s : map.keySet()) {
			if ( map.get(s) == cntmax ) {
				list.add(s);
			}
		}
		String[] ans = list.toArray(new String[list.size()]);
		Arrays.sort(ans);

		StringBuilder ret = new StringBuilder();
		for ( String s : ans ) {
			ret.append(s);
			ret.append("\n");
		}
		System.out.println(ret.toString());
	}
} Main
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

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();

		HashMap<String, Integer> map = new HashMap<>();
		int cntmax = 0;
		for ( String s : S ) {
			if ( map.containsKey(s) ) {
				int cnt = map.get(s) + 1;
				map.put(s, cnt);
				cntmax = Math.max(cnt, cntmax);
			} else {
				map.put(s, 1);
				cntmax = Math.max(1, cntmax);
			}
		}

		ArrayList<String> list = new ArrayList<>();
		for (String s : map.keySet()) {
			if ( map.get(s) == cntmax ) {
				list.add(s);
			}
		}
		String[] ans = list.toArray(new String[list.size()]);
		Arrays.sort(ans);

		StringBuilder ret = new StringBuilder();
		for ( String s : ans ) {
			ret.append(s);
			ret.append("\n");
		}
		System.out.println(ret.toString());
	}
}
