import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// 自分の得意な言語で
		// Let's チャレンジ！！
		// APPROVED
		// DENIED

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int max = 1;
		String w = "";
		Map<String, Integer> map = new HashMap<>();
		List<String> strArr = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			w = sc.next();
			if (map.get(w) == null) {
				map.put(w, 1);
			} else {
				map.put(w, map.get(w) + 1);
				if (map.get(w) > max) {
					max = map.get(w);
				}
			}
		}
		for (Entry<String, Integer> entry : map.entrySet()) {
			if (entry.getValue() == max) {
				strArr.add(entry.getKey());
			}
		}
		Collections.sort(strArr);

		for (String str : strArr) {
			System.out.println(str);
		}

	}

} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Map.Entry; Entry java.util.Map import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// 自分の得意な言語で
		// Let's チャレンジ！！
		// APPROVED
		// DENIED

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int max = 1;
		String w = "";
		Map<String, Integer> map = new HashMap<>();
		List<String> strArr = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			w = sc.next();
			if (map.get(w) == null) {
				map.put(w, 1);
			} else {
				map.put(w, map.get(w) + 1);
				if (map.get(w) > max) {
					max = map.get(w);
				}
			}
		}
		for (Entry<String, Integer> entry : map.entrySet()) {
			if (entry.getValue() == max) {
				strArr.add(entry.getKey());
			}
		}
		Collections.sort(strArr);

		for (String str : strArr) {
			System.out.println(str);
		}

	}

} Main public static void main(String[] args) {
		// 自分の得意な言語で
		// Let's チャレンジ！！
		// APPROVED
		// DENIED

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int max = 1;
		String w = "";
		Map<String, Integer> map = new HashMap<>();
		List<String> strArr = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			w = sc.next();
			if (map.get(w) == null) {
				map.put(w, 1);
			} else {
				map.put(w, map.get(w) + 1);
				if (map.get(w) > max) {
					max = map.get(w);
				}
			}
		}
		for (Entry<String, Integer> entry : map.entrySet()) {
			if (entry.getValue() == max) {
				strArr.add(entry.getKey());
			}
		}
		Collections.sort(strArr);

		for (String str : strArr) {
			System.out.println(str);
		}

	} main {
		// 自分の得意な言語で
		// Let's チャレンジ！！
		// APPROVED
		// DENIED

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int max = 1;
		String w = "";
		Map<String, Integer> map = new HashMap<>();
		List<String> strArr = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			w = sc.next();
			if (map.get(w) == null) {
				map.put(w, 1);
			} else {
				map.put(w, map.get(w) + 1);
				if (map.get(w) > max) {
					max = map.get(w);
				}
			}
		}
		for (Entry<String, Integer> entry : map.entrySet()) {
			if (entry.getValue() == max) {
				strArr.add(entry.getKey());
			}
		}
		Collections.sort(strArr);

		for (String str : strArr) {
			System.out.println(str);
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int max = 1; max 1 String w = ""; w "" Map<String, Integer> map = new HashMap<>(); map new HashMap<>() List<String> strArr = new ArrayList<>(); strArr new ArrayList<>() for (int i = 0; i < n; i++) {
			w = sc.next();
			if (map.get(w) == null) {
				map.put(w, 1);
			} else {
				map.put(w, map.get(w) + 1);
				if (map.get(w) > max) {
					max = map.get(w);
				}
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			w = sc.next();
			if (map.get(w) == null) {
				map.put(w, 1);
			} else {
				map.put(w, map.get(w) + 1);
				if (map.get(w) > max) {
					max = map.get(w);
				}
			}
		} {
			w = sc.next();
			if (map.get(w) == null) {
				map.put(w, 1);
			} else {
				map.put(w, map.get(w) + 1);
				if (map.get(w) > max) {
					max = map.get(w);
				}
			}
		} w = sc.next() w sc.next() sc.next sc if (map.get(w) == null) {
				map.put(w, 1);
			} else {
				map.put(w, map.get(w) + 1);
				if (map.get(w) > max) {
					max = map.get(w);
				}
			} map.get(w) == null map.get(w) map.get map w null {
				map.put(w, 1);
			} map.put(w, 1) map.put map w 1 {
				map.put(w, map.get(w) + 1);
				if (map.get(w) > max) {
					max = map.get(w);
				}
			} map.put(w, map.get(w) + 1) map.put map w map.get(w) + 1 map.get(w) map.get map w 1 if (map.get(w) > max) {
					max = map.get(w);
				} map.get(w) > max map.get(w) map.get map w max {
					max = map.get(w);
				} max = map.get(w) max map.get(w) map.get map w for (Entry<String, Integer> entry : map.entrySet()) {
			if (entry.getValue() == max) {
				strArr.add(entry.getKey());
			}
		} Entry<String, Integer> entry map.entrySet() map.entrySet map {
			if (entry.getValue() == max) {
				strArr.add(entry.getKey());
			}
		} {
			if (entry.getValue() == max) {
				strArr.add(entry.getKey());
			}
		} if (entry.getValue() == max) {
				strArr.add(entry.getKey());
			} entry.getValue() == max entry.getValue() entry.getValue entry max {
				strArr.add(entry.getKey());
			} strArr.add(entry.getKey()) strArr.add strArr entry.getKey() entry.getKey entry Collections.sort(strArr) Collections.sort Collections strArr for (String str : strArr) {
			System.out.println(str);
		} String str strArr {
			System.out.println(str);
		} {
			System.out.println(str);
		} System.out.println(str) System.out.println System.out System System.out str String[] args args public class Main {

	public static void main(String[] args) {
		// 自分の得意な言語で
		// Let's チャレンジ！！
		// APPROVED
		// DENIED

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int max = 1;
		String w = "";
		Map<String, Integer> map = new HashMap<>();
		List<String> strArr = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			w = sc.next();
			if (map.get(w) == null) {
				map.put(w, 1);
			} else {
				map.put(w, map.get(w) + 1);
				if (map.get(w) > max) {
					max = map.get(w);
				}
			}
		}
		for (Entry<String, Integer> entry : map.entrySet()) {
			if (entry.getValue() == max) {
				strArr.add(entry.getKey());
			}
		}
		Collections.sort(strArr);

		for (String str : strArr) {
			System.out.println(str);
		}

	}

} public class Main {

	public static void main(String[] args) {
		// 自分の得意な言語で
		// Let's チャレンジ！！
		// APPROVED
		// DENIED

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int max = 1;
		String w = "";
		Map<String, Integer> map = new HashMap<>();
		List<String> strArr = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			w = sc.next();
			if (map.get(w) == null) {
				map.put(w, 1);
			} else {
				map.put(w, map.get(w) + 1);
				if (map.get(w) > max) {
					max = map.get(w);
				}
			}
		}
		for (Entry<String, Integer> entry : map.entrySet()) {
			if (entry.getValue() == max) {
				strArr.add(entry.getKey());
			}
		}
		Collections.sort(strArr);

		for (String str : strArr) {
			System.out.println(str);
		}

	}

} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// 自分の得意な言語で
		// Let's チャレンジ！！
		// APPROVED
		// DENIED

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int max = 1;
		String w = "";
		Map<String, Integer> map = new HashMap<>();
		List<String> strArr = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			w = sc.next();
			if (map.get(w) == null) {
				map.put(w, 1);
			} else {
				map.put(w, map.get(w) + 1);
				if (map.get(w) > max) {
					max = map.get(w);
				}
			}
		}
		for (Entry<String, Integer> entry : map.entrySet()) {
			if (entry.getValue() == max) {
				strArr.add(entry.getKey());
			}
		}
		Collections.sort(strArr);

		for (String str : strArr) {
			System.out.println(str);
		}

	}

}