import java.util.*;

class Main {
	Scanner sc;
	int N;
	Map<String, Integer> map;
	
	private void calc() {
		sc = new Scanner(System.in);
		N = sc.nextInt();
		map = new TreeMap<>();
		int max = -1;
		for (int i = 0; i < N; i++) {
			String s = sc.next();
			int c = map.getOrDefault(s, 0) + 1;
			max = Math.max(max, c);
			map.put(s, c);
		}
		for (String s : map.keySet()) {
			if (map.get(s) == max) System.out.println(s);
		}
	}

	public static void main(String[] args) {
		new Main().calc();
	}
} import java.util.*; util.* java class Main {
	Scanner sc;
	int N;
	Map<String, Integer> map;
	
	private void calc() {
		sc = new Scanner(System.in);
		N = sc.nextInt();
		map = new TreeMap<>();
		int max = -1;
		for (int i = 0; i < N; i++) {
			String s = sc.next();
			int c = map.getOrDefault(s, 0) + 1;
			max = Math.max(max, c);
			map.put(s, c);
		}
		for (String s : map.keySet()) {
			if (map.get(s) == max) System.out.println(s);
		}
	}

	public static void main(String[] args) {
		new Main().calc();
	}
} Main Scanner sc; sc int N; N Map<String, Integer> map; map private void calc() {
		sc = new Scanner(System.in);
		N = sc.nextInt();
		map = new TreeMap<>();
		int max = -1;
		for (int i = 0; i < N; i++) {
			String s = sc.next();
			int c = map.getOrDefault(s, 0) + 1;
			max = Math.max(max, c);
			map.put(s, c);
		}
		for (String s : map.keySet()) {
			if (map.get(s) == max) System.out.println(s);
		}
	} calc {
		sc = new Scanner(System.in);
		N = sc.nextInt();
		map = new TreeMap<>();
		int max = -1;
		for (int i = 0; i < N; i++) {
			String s = sc.next();
			int c = map.getOrDefault(s, 0) + 1;
			max = Math.max(max, c);
			map.put(s, c);
		}
		for (String s : map.keySet()) {
			if (map.get(s) == max) System.out.println(s);
		}
	} sc = new Scanner(System.in) sc new Scanner(System.in) N = sc.nextInt() N sc.nextInt() sc.nextInt sc map = new TreeMap<>() map new TreeMap<>() int max = -1; max -1 1 for (int i = 0; i < N; i++) {
			String s = sc.next();
			int c = map.getOrDefault(s, 0) + 1;
			max = Math.max(max, c);
			map.put(s, c);
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			String s = sc.next();
			int c = map.getOrDefault(s, 0) + 1;
			max = Math.max(max, c);
			map.put(s, c);
		} {
			String s = sc.next();
			int c = map.getOrDefault(s, 0) + 1;
			max = Math.max(max, c);
			map.put(s, c);
		} String s = sc.next(); s sc.next() sc.next sc int c = map.getOrDefault(s, 0) + 1; c map.getOrDefault(s, 0) + 1 map.getOrDefault(s, 0) map.getOrDefault map s 0 1 max = Math.max(max, c) max Math.max(max, c) Math.max Math max c map.put(s, c) map.put map s c for (String s : map.keySet()) {
			if (map.get(s) == max) System.out.println(s);
		} String s map.keySet() map.keySet map {
			if (map.get(s) == max) System.out.println(s);
		} {
			if (map.get(s) == max) System.out.println(s);
		} if (map.get(s) == max) System.out.println(s); map.get(s) == max map.get(s) map.get map s max System.out.println(s) System.out.println System.out System System.out s public static void main(String[] args) {
		new Main().calc();
	} main {
		new Main().calc();
	} new Main().calc() new Main().calc new Main() String[] args args
import java.util.*;

class Main {
	Scanner sc;
	int N;
	Map<String, Integer> map;
	
	private void calc() {
		sc = new Scanner(System.in);
		N = sc.nextInt();
		map = new TreeMap<>();
		int max = -1;
		for (int i = 0; i < N; i++) {
			String s = sc.next();
			int c = map.getOrDefault(s, 0) + 1;
			max = Math.max(max, c);
			map.put(s, c);
		}
		for (String s : map.keySet()) {
			if (map.get(s) == max) System.out.println(s);
		}
	}

	public static void main(String[] args) {
		new Main().calc();
	}
}
