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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		HashMap<String, Integer> S = new HashMap<String, Integer>();
		for (int i = 0; i < N; i++) {
			String SS = sc.next();
			if (S.containsKey(SS)) {
				S.put(SS, S.get(SS) + 1);
			} else {
				S.put(SS, 1);
			}
		}
		int max = 0;
		for (Entry<String, Integer> entry : S.entrySet()) {
			if (entry.getValue() > max)
				max = entry.getValue();
		}
		List<String> maxList = new ArrayList<String>();
		for (Entry<String, Integer> entry : S.entrySet()) {
			if (entry.getValue() == max) {
				maxList.add(entry.getKey());
			}
		}
		Collections.sort(maxList);
		for (String string : maxList) {
			System.out.println(string);
		}
	}
} import java.util.*; util.* java import java.util.Map.Entry; Entry java.util.Map public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		HashMap<String, Integer> S = new HashMap<String, Integer>();
		for (int i = 0; i < N; i++) {
			String SS = sc.next();
			if (S.containsKey(SS)) {
				S.put(SS, S.get(SS) + 1);
			} else {
				S.put(SS, 1);
			}
		}
		int max = 0;
		for (Entry<String, Integer> entry : S.entrySet()) {
			if (entry.getValue() > max)
				max = entry.getValue();
		}
		List<String> maxList = new ArrayList<String>();
		for (Entry<String, Integer> entry : S.entrySet()) {
			if (entry.getValue() == max) {
				maxList.add(entry.getKey());
			}
		}
		Collections.sort(maxList);
		for (String string : maxList) {
			System.out.println(string);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		HashMap<String, Integer> S = new HashMap<String, Integer>();
		for (int i = 0; i < N; i++) {
			String SS = sc.next();
			if (S.containsKey(SS)) {
				S.put(SS, S.get(SS) + 1);
			} else {
				S.put(SS, 1);
			}
		}
		int max = 0;
		for (Entry<String, Integer> entry : S.entrySet()) {
			if (entry.getValue() > max)
				max = entry.getValue();
		}
		List<String> maxList = new ArrayList<String>();
		for (Entry<String, Integer> entry : S.entrySet()) {
			if (entry.getValue() == max) {
				maxList.add(entry.getKey());
			}
		}
		Collections.sort(maxList);
		for (String string : maxList) {
			System.out.println(string);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		HashMap<String, Integer> S = new HashMap<String, Integer>();
		for (int i = 0; i < N; i++) {
			String SS = sc.next();
			if (S.containsKey(SS)) {
				S.put(SS, S.get(SS) + 1);
			} else {
				S.put(SS, 1);
			}
		}
		int max = 0;
		for (Entry<String, Integer> entry : S.entrySet()) {
			if (entry.getValue() > max)
				max = entry.getValue();
		}
		List<String> maxList = new ArrayList<String>();
		for (Entry<String, Integer> entry : S.entrySet()) {
			if (entry.getValue() == max) {
				maxList.add(entry.getKey());
			}
		}
		Collections.sort(maxList);
		for (String string : maxList) {
			System.out.println(string);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc HashMap<String, Integer> S = new HashMap<String, Integer>(); S new HashMap<String, Integer>() for (int i = 0; i < N; i++) {
			String SS = sc.next();
			if (S.containsKey(SS)) {
				S.put(SS, S.get(SS) + 1);
			} else {
				S.put(SS, 1);
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			String SS = sc.next();
			if (S.containsKey(SS)) {
				S.put(SS, S.get(SS) + 1);
			} else {
				S.put(SS, 1);
			}
		} {
			String SS = sc.next();
			if (S.containsKey(SS)) {
				S.put(SS, S.get(SS) + 1);
			} else {
				S.put(SS, 1);
			}
		} String SS = sc.next(); SS sc.next() sc.next sc if (S.containsKey(SS)) {
				S.put(SS, S.get(SS) + 1);
			} else {
				S.put(SS, 1);
			} S.containsKey(SS) S.containsKey S SS {
				S.put(SS, S.get(SS) + 1);
			} S.put(SS, S.get(SS) + 1) S.put S SS S.get(SS) + 1 S.get(SS) S.get S SS 1 {
				S.put(SS, 1);
			} S.put(SS, 1) S.put S SS 1 int max = 0; max 0 for (Entry<String, Integer> entry : S.entrySet()) {
			if (entry.getValue() > max)
				max = entry.getValue();
		} Entry<String, Integer> entry S.entrySet() S.entrySet S {
			if (entry.getValue() > max)
				max = entry.getValue();
		} {
			if (entry.getValue() > max)
				max = entry.getValue();
		} if (entry.getValue() > max)
				max = entry.getValue(); entry.getValue() > max entry.getValue() entry.getValue entry max max = entry.getValue() max entry.getValue() entry.getValue entry List<String> maxList = new ArrayList<String>(); maxList new ArrayList<String>() for (Entry<String, Integer> entry : S.entrySet()) {
			if (entry.getValue() == max) {
				maxList.add(entry.getKey());
			}
		} Entry<String, Integer> entry S.entrySet() S.entrySet S {
			if (entry.getValue() == max) {
				maxList.add(entry.getKey());
			}
		} {
			if (entry.getValue() == max) {
				maxList.add(entry.getKey());
			}
		} if (entry.getValue() == max) {
				maxList.add(entry.getKey());
			} entry.getValue() == max entry.getValue() entry.getValue entry max {
				maxList.add(entry.getKey());
			} maxList.add(entry.getKey()) maxList.add maxList entry.getKey() entry.getKey entry Collections.sort(maxList) Collections.sort Collections maxList for (String string : maxList) {
			System.out.println(string);
		} String string maxList {
			System.out.println(string);
		} {
			System.out.println(string);
		} System.out.println(string) System.out.println System.out System System.out string String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		HashMap<String, Integer> S = new HashMap<String, Integer>();
		for (int i = 0; i < N; i++) {
			String SS = sc.next();
			if (S.containsKey(SS)) {
				S.put(SS, S.get(SS) + 1);
			} else {
				S.put(SS, 1);
			}
		}
		int max = 0;
		for (Entry<String, Integer> entry : S.entrySet()) {
			if (entry.getValue() > max)
				max = entry.getValue();
		}
		List<String> maxList = new ArrayList<String>();
		for (Entry<String, Integer> entry : S.entrySet()) {
			if (entry.getValue() == max) {
				maxList.add(entry.getKey());
			}
		}
		Collections.sort(maxList);
		for (String string : maxList) {
			System.out.println(string);
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		HashMap<String, Integer> S = new HashMap<String, Integer>();
		for (int i = 0; i < N; i++) {
			String SS = sc.next();
			if (S.containsKey(SS)) {
				S.put(SS, S.get(SS) + 1);
			} else {
				S.put(SS, 1);
			}
		}
		int max = 0;
		for (Entry<String, Integer> entry : S.entrySet()) {
			if (entry.getValue() > max)
				max = entry.getValue();
		}
		List<String> maxList = new ArrayList<String>();
		for (Entry<String, Integer> entry : S.entrySet()) {
			if (entry.getValue() == max) {
				maxList.add(entry.getKey());
			}
		}
		Collections.sort(maxList);
		for (String string : maxList) {
			System.out.println(string);
		}
	}
} Main
import java.util.*;
import java.util.Map.Entry;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		HashMap<String, Integer> S = new HashMap<String, Integer>();
		for (int i = 0; i < N; i++) {
			String SS = sc.next();
			if (S.containsKey(SS)) {
				S.put(SS, S.get(SS) + 1);
			} else {
				S.put(SS, 1);
			}
		}
		int max = 0;
		for (Entry<String, Integer> entry : S.entrySet()) {
			if (entry.getValue() > max)
				max = entry.getValue();
		}
		List<String> maxList = new ArrayList<String>();
		for (Entry<String, Integer> entry : S.entrySet()) {
			if (entry.getValue() == max) {
				maxList.add(entry.getKey());
			}
		}
		Collections.sort(maxList);
		for (String string : maxList) {
			System.out.println(string);
		}
	}
}