import java.util.*;
import java.util.stream.Collectors;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {
	int N;
	List<String> list;
	Map<String, Integer> map;
	List<String> result;

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		N = Integer.parseInt(in.readLine());
		list = new ArrayList<>(N);
		for (int i = 0; i < N; ++i) {
			list.add(in.readLine());
		}
	}

	void calc() {
		map = new HashMap<>();
		for (String str : list) {
			if (map.containsKey(str)) {
				map.put(str, map.get(str) + 1);
			} else {
				map.put(str, 1);
			}
		}
		// 最大の回数を求める
		int count = 0;
		for (Integer val : map.values()) {
			count = Math.max(val, count);
		}
		// 最大の回数と同じ回数出現した要素を求める
		result = new ArrayList<>();
		for (String str : map.keySet()) {
			if (count == map.get(str)) {
				result.add(str);
			}
		}
		Collections.sort(result);
	}

	void showResult() {
		for (String str : result) {
			System.out.println(str);
		}
	}
} import java.util.*; util.* java import java.util.stream.Collectors; Collectors java.util.stream import java.io.*; io.* java import java.nio.charset.StandardCharsets; StandardCharsets java.nio.charset public class Main {
	int N;
	List<String> list;
	Map<String, Integer> map;
	List<String> result;

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		N = Integer.parseInt(in.readLine());
		list = new ArrayList<>(N);
		for (int i = 0; i < N; ++i) {
			list.add(in.readLine());
		}
	}

	void calc() {
		map = new HashMap<>();
		for (String str : list) {
			if (map.containsKey(str)) {
				map.put(str, map.get(str) + 1);
			} else {
				map.put(str, 1);
			}
		}
		// 最大の回数を求める
		int count = 0;
		for (Integer val : map.values()) {
			count = Math.max(val, count);
		}
		// 最大の回数と同じ回数出現した要素を求める
		result = new ArrayList<>();
		for (String str : map.keySet()) {
			if (count == map.get(str)) {
				result.add(str);
			}
		}
		Collections.sort(result);
	}

	void showResult() {
		for (String str : result) {
			System.out.println(str);
		}
	}
} Main int N; N List<String> list; list Map<String, Integer> map; map List<String> result; result public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	} main {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	} InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8); reader new InputStreamReader(System.in, StandardCharsets.UTF_8) BufferedReader in = new BufferedReader(reader); in new BufferedReader(reader) Main ins = new Main(in); ins new Main(in) ins.calc() ins.calc ins ins.showResult() ins.showResult ins String[] args args Main(BufferedReader in) throws IOException {
		N = Integer.parseInt(in.readLine());
		list = new ArrayList<>(N);
		for (int i = 0; i < N; ++i) {
			list.add(in.readLine());
		}
	} Main {
		N = Integer.parseInt(in.readLine());
		list = new ArrayList<>(N);
		for (int i = 0; i < N; ++i) {
			list.add(in.readLine());
		}
	} N = Integer.parseInt(in.readLine()) N Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in list = new ArrayList<>(N) list new ArrayList<>(N) for (int i = 0; i < N; ++i) {
			list.add(in.readLine());
		} int i = 0; int i = 0; i 0 i < N i N ++i ++i i {
			list.add(in.readLine());
		} {
			list.add(in.readLine());
		} list.add(in.readLine()) list.add list in.readLine() in.readLine in BufferedReader in in void calc() {
		map = new HashMap<>();
		for (String str : list) {
			if (map.containsKey(str)) {
				map.put(str, map.get(str) + 1);
			} else {
				map.put(str, 1);
			}
		}
		// 最大の回数を求める
		int count = 0;
		for (Integer val : map.values()) {
			count = Math.max(val, count);
		}
		// 最大の回数と同じ回数出現した要素を求める
		result = new ArrayList<>();
		for (String str : map.keySet()) {
			if (count == map.get(str)) {
				result.add(str);
			}
		}
		Collections.sort(result);
	} calc {
		map = new HashMap<>();
		for (String str : list) {
			if (map.containsKey(str)) {
				map.put(str, map.get(str) + 1);
			} else {
				map.put(str, 1);
			}
		}
		// 最大の回数を求める
		int count = 0;
		for (Integer val : map.values()) {
			count = Math.max(val, count);
		}
		// 最大の回数と同じ回数出現した要素を求める
		result = new ArrayList<>();
		for (String str : map.keySet()) {
			if (count == map.get(str)) {
				result.add(str);
			}
		}
		Collections.sort(result);
	} map = new HashMap<>() map new HashMap<>() for (String str : list) {
			if (map.containsKey(str)) {
				map.put(str, map.get(str) + 1);
			} else {
				map.put(str, 1);
			}
		} String str list {
			if (map.containsKey(str)) {
				map.put(str, map.get(str) + 1);
			} else {
				map.put(str, 1);
			}
		} {
			if (map.containsKey(str)) {
				map.put(str, map.get(str) + 1);
			} else {
				map.put(str, 1);
			}
		} if (map.containsKey(str)) {
				map.put(str, map.get(str) + 1);
			} else {
				map.put(str, 1);
			} map.containsKey(str) map.containsKey map str {
				map.put(str, map.get(str) + 1);
			} map.put(str, map.get(str) + 1) map.put map str map.get(str) + 1 map.get(str) map.get map str 1 {
				map.put(str, 1);
			} map.put(str, 1) map.put map str 1 int count = 0; count 0 for (Integer val : map.values()) {
			count = Math.max(val, count);
		} Integer val map.values() map.values map {
			count = Math.max(val, count);
		} {
			count = Math.max(val, count);
		} count = Math.max(val, count) count Math.max(val, count) Math.max Math val count result = new ArrayList<>() result new ArrayList<>() for (String str : map.keySet()) {
			if (count == map.get(str)) {
				result.add(str);
			}
		} String str map.keySet() map.keySet map {
			if (count == map.get(str)) {
				result.add(str);
			}
		} {
			if (count == map.get(str)) {
				result.add(str);
			}
		} if (count == map.get(str)) {
				result.add(str);
			} count == map.get(str) count map.get(str) map.get map str {
				result.add(str);
			} result.add(str) result.add result str Collections.sort(result) Collections.sort Collections result void showResult() {
		for (String str : result) {
			System.out.println(str);
		}
	} showResult {
		for (String str : result) {
			System.out.println(str);
		}
	} for (String str : result) {
			System.out.println(str);
		} String str result {
			System.out.println(str);
		} {
			System.out.println(str);
		} System.out.println(str) System.out.println System.out System System.out str public class Main {
	int N;
	List<String> list;
	Map<String, Integer> map;
	List<String> result;

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		N = Integer.parseInt(in.readLine());
		list = new ArrayList<>(N);
		for (int i = 0; i < N; ++i) {
			list.add(in.readLine());
		}
	}

	void calc() {
		map = new HashMap<>();
		for (String str : list) {
			if (map.containsKey(str)) {
				map.put(str, map.get(str) + 1);
			} else {
				map.put(str, 1);
			}
		}
		// 最大の回数を求める
		int count = 0;
		for (Integer val : map.values()) {
			count = Math.max(val, count);
		}
		// 最大の回数と同じ回数出現した要素を求める
		result = new ArrayList<>();
		for (String str : map.keySet()) {
			if (count == map.get(str)) {
				result.add(str);
			}
		}
		Collections.sort(result);
	}

	void showResult() {
		for (String str : result) {
			System.out.println(str);
		}
	}
} public class Main {
	int N;
	List<String> list;
	Map<String, Integer> map;
	List<String> result;

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		N = Integer.parseInt(in.readLine());
		list = new ArrayList<>(N);
		for (int i = 0; i < N; ++i) {
			list.add(in.readLine());
		}
	}

	void calc() {
		map = new HashMap<>();
		for (String str : list) {
			if (map.containsKey(str)) {
				map.put(str, map.get(str) + 1);
			} else {
				map.put(str, 1);
			}
		}
		// 最大の回数を求める
		int count = 0;
		for (Integer val : map.values()) {
			count = Math.max(val, count);
		}
		// 最大の回数と同じ回数出現した要素を求める
		result = new ArrayList<>();
		for (String str : map.keySet()) {
			if (count == map.get(str)) {
				result.add(str);
			}
		}
		Collections.sort(result);
	}

	void showResult() {
		for (String str : result) {
			System.out.println(str);
		}
	}
} Main
import java.util.*;
import java.util.stream.Collectors;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {
	int N;
	List<String> list;
	Map<String, Integer> map;
	List<String> result;

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		N = Integer.parseInt(in.readLine());
		list = new ArrayList<>(N);
		for (int i = 0; i < N; ++i) {
			list.add(in.readLine());
		}
	}

	void calc() {
		map = new HashMap<>();
		for (String str : list) {
			if (map.containsKey(str)) {
				map.put(str, map.get(str) + 1);
			} else {
				map.put(str, 1);
			}
		}
		// 最大の回数を求める
		int count = 0;
		for (Integer val : map.values()) {
			count = Math.max(val, count);
		}
		// 最大の回数と同じ回数出現した要素を求める
		result = new ArrayList<>();
		for (String str : map.keySet()) {
			if (count == map.get(str)) {
				result.add(str);
			}
		}
		Collections.sort(result);
	}

	void showResult() {
		for (String str : result) {
			System.out.println(str);
		}
	}
}
