import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		Map<String, Integer> map = new HashMap<>();
		for (int i = 0; i < n; i++) {
			String s = br.readLine();
			if (map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
		}
		br.close();

		int max = 0;
		for (int i : map.values()) {
			max = Math.max(max, i);
		}

		List<String> list = new ArrayList<>();
		for (String s : map.keySet()) {
			if (map.get(s) == max) {
				list.add(s);
			}
		}
		Collections.sort(list);

		for (String s : list) {
			System.out.println(s);
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io 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 public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		Map<String, Integer> map = new HashMap<>();
		for (int i = 0; i < n; i++) {
			String s = br.readLine();
			if (map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
		}
		br.close();

		int max = 0;
		for (int i : map.values()) {
			max = Math.max(max, i);
		}

		List<String> list = new ArrayList<>();
		for (String s : map.keySet()) {
			if (map.get(s) == max) {
				list.add(s);
			}
		}
		Collections.sort(list);

		for (String s : list) {
			System.out.println(s);
		}
	}
} Main public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		Map<String, Integer> map = new HashMap<>();
		for (int i = 0; i < n; i++) {
			String s = br.readLine();
			if (map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
		}
		br.close();

		int max = 0;
		for (int i : map.values()) {
			max = Math.max(max, i);
		}

		List<String> list = new ArrayList<>();
		for (String s : map.keySet()) {
			if (map.get(s) == max) {
				list.add(s);
			}
		}
		Collections.sort(list);

		for (String s : list) {
			System.out.println(s);
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		Map<String, Integer> map = new HashMap<>();
		for (int i = 0; i < n; i++) {
			String s = br.readLine();
			if (map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
		}
		br.close();

		int max = 0;
		for (int i : map.values()) {
			max = Math.max(max, i);
		}

		List<String> list = new ArrayList<>();
		for (String s : map.keySet()) {
			if (map.get(s) == max) {
				list.add(s);
			}
		}
		Collections.sort(list);

		for (String s : list) {
			System.out.println(s);
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br Map<String, Integer> map = new HashMap<>(); map new HashMap<>() for (int i = 0; i < n; i++) {
			String s = br.readLine();
			if (map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String s = br.readLine();
			if (map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
		} {
			String s = br.readLine();
			if (map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
		} String s = br.readLine(); s br.readLine() br.readLine br if (map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			} map.containsKey(s) map.containsKey map s {
				map.put(s, map.get(s) + 1);
			} map.put(s, map.get(s) + 1) map.put map s map.get(s) + 1 map.get(s) map.get map s 1 {
				map.put(s, 1);
			} map.put(s, 1) map.put map s 1 br.close() br.close br int max = 0; max 0 for (int i : map.values()) {
			max = Math.max(max, i);
		} int i map.values() map.values map {
			max = Math.max(max, i);
		} {
			max = Math.max(max, i);
		} max = Math.max(max, i) max Math.max(max, i) Math.max Math max i List<String> list = new ArrayList<>(); list new ArrayList<>() for (String s : map.keySet()) {
			if (map.get(s) == max) {
				list.add(s);
			}
		} String s map.keySet() map.keySet map {
			if (map.get(s) == max) {
				list.add(s);
			}
		} {
			if (map.get(s) == max) {
				list.add(s);
			}
		} if (map.get(s) == max) {
				list.add(s);
			} map.get(s) == max map.get(s) map.get map s max {
				list.add(s);
			} list.add(s) list.add list s 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) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		Map<String, Integer> map = new HashMap<>();
		for (int i = 0; i < n; i++) {
			String s = br.readLine();
			if (map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
		}
		br.close();

		int max = 0;
		for (int i : map.values()) {
			max = Math.max(max, i);
		}

		List<String> list = new ArrayList<>();
		for (String s : map.keySet()) {
			if (map.get(s) == max) {
				list.add(s);
			}
		}
		Collections.sort(list);

		for (String s : list) {
			System.out.println(s);
		}
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		Map<String, Integer> map = new HashMap<>();
		for (int i = 0; i < n; i++) {
			String s = br.readLine();
			if (map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
		}
		br.close();

		int max = 0;
		for (int i : map.values()) {
			max = Math.max(max, i);
		}

		List<String> list = new ArrayList<>();
		for (String s : map.keySet()) {
			if (map.get(s) == max) {
				list.add(s);
			}
		}
		Collections.sort(list);

		for (String s : list) {
			System.out.println(s);
		}
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		Map<String, Integer> map = new HashMap<>();
		for (int i = 0; i < n; i++) {
			String s = br.readLine();
			if (map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
		}
		br.close();

		int max = 0;
		for (int i : map.values()) {
			max = Math.max(max, i);
		}

		List<String> list = new ArrayList<>();
		for (String s : map.keySet()) {
			if (map.get(s) == max) {
				list.add(s);
			}
		}
		Collections.sort(list);

		for (String s : list) {
			System.out.println(s);
		}
	}
}
