import java.io.PrintWriter;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new TreeMap<>();
		int max = 0;
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			int val = map.containsKey(s) ? map.get(s) + 1 : 1;
			map.put(s, val);
			max = Math.max(max, val);
		}
		PrintWriter out = new PrintWriter(System.out);
		for (String key : map.keySet()) {
			if (map.get(key) == max) {
				out.println(key);
			}
		}
		out.flush();
	}
} import java.io.PrintWriter; PrintWriter java.io import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util import java.util.TreeMap; TreeMap java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new TreeMap<>();
		int max = 0;
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			int val = map.containsKey(s) ? map.get(s) + 1 : 1;
			map.put(s, val);
			max = Math.max(max, val);
		}
		PrintWriter out = new PrintWriter(System.out);
		for (String key : map.keySet()) {
			if (map.get(key) == max) {
				out.println(key);
			}
		}
		out.flush();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new TreeMap<>();
		int max = 0;
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			int val = map.containsKey(s) ? map.get(s) + 1 : 1;
			map.put(s, val);
			max = Math.max(max, val);
		}
		PrintWriter out = new PrintWriter(System.out);
		for (String key : map.keySet()) {
			if (map.get(key) == max) {
				out.println(key);
			}
		}
		out.flush();
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new TreeMap<>();
		int max = 0;
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			int val = map.containsKey(s) ? map.get(s) + 1 : 1;
			map.put(s, val);
			max = Math.max(max, val);
		}
		PrintWriter out = new PrintWriter(System.out);
		for (String key : map.keySet()) {
			if (map.get(key) == max) {
				out.println(key);
			}
		}
		out.flush();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Map<String, Integer> map = new TreeMap<>(); map new TreeMap<>() int max = 0; max 0 for (int i = 0; i < n; i++) {
			String s = sc.next();
			int val = map.containsKey(s) ? map.get(s) + 1 : 1;
			map.put(s, val);
			max = Math.max(max, val);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String s = sc.next();
			int val = map.containsKey(s) ? map.get(s) + 1 : 1;
			map.put(s, val);
			max = Math.max(max, val);
		} {
			String s = sc.next();
			int val = map.containsKey(s) ? map.get(s) + 1 : 1;
			map.put(s, val);
			max = Math.max(max, val);
		} String s = sc.next(); s sc.next() sc.next sc int val = map.containsKey(s) ? map.get(s) + 1 : 1; val map.containsKey(s) ? map.get(s) + 1 : 1 map.containsKey(s) map.containsKey map s map.get(s) + 1 map.get(s) map.get map s 1 1 map.put(s, val) map.put map s val max = Math.max(max, val) max Math.max(max, val) Math.max Math max val PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) for (String key : map.keySet()) {
			if (map.get(key) == max) {
				out.println(key);
			}
		} String key map.keySet() map.keySet map {
			if (map.get(key) == max) {
				out.println(key);
			}
		} {
			if (map.get(key) == max) {
				out.println(key);
			}
		} if (map.get(key) == max) {
				out.println(key);
			} map.get(key) == max map.get(key) map.get map key max {
				out.println(key);
			} out.println(key) out.println out key out.flush() out.flush out String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new TreeMap<>();
		int max = 0;
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			int val = map.containsKey(s) ? map.get(s) + 1 : 1;
			map.put(s, val);
			max = Math.max(max, val);
		}
		PrintWriter out = new PrintWriter(System.out);
		for (String key : map.keySet()) {
			if (map.get(key) == max) {
				out.println(key);
			}
		}
		out.flush();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new TreeMap<>();
		int max = 0;
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			int val = map.containsKey(s) ? map.get(s) + 1 : 1;
			map.put(s, val);
			max = Math.max(max, val);
		}
		PrintWriter out = new PrintWriter(System.out);
		for (String key : map.keySet()) {
			if (map.get(key) == max) {
				out.println(key);
			}
		}
		out.flush();
	}
} Main
import java.io.PrintWriter;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new TreeMap<>();
		int max = 0;
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			int val = map.containsKey(s) ? map.get(s) + 1 : 1;
			map.put(s, val);
			max = Math.max(max, val);
		}
		PrintWriter out = new PrintWriter(System.out);
		for (String key : map.keySet()) {
			if (map.get(key) == max) {
				out.println(key);
			}
		}
		out.flush();
	}
}