import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new HashMap<>();

		int max = 0;
		for(int i = 0; i < n; i++) {
			String s = sc.next();

			Integer nowCount = map.get(s);
			Integer newCount = null;
			if(nowCount == null) {
				newCount = 1;
			} else {
				newCount = nowCount + 1;
			}

			map.put(s, newCount);
			max = Math.max(max, newCount);
		}

		Set<String> set = new TreeSet<>();
		for(Entry<String, Integer> entry : map.entrySet()) {
			if(max == entry.getValue()) {
				set.add(entry.getKey());
			}
		}

		for(String name : set) {
			System.out.println(name);
		}
	}
} import java.util.HashMap; HashMap 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 import java.util.Set; Set java.util import java.util.TreeSet; TreeSet 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 HashMap<>();

		int max = 0;
		for(int i = 0; i < n; i++) {
			String s = sc.next();

			Integer nowCount = map.get(s);
			Integer newCount = null;
			if(nowCount == null) {
				newCount = 1;
			} else {
				newCount = nowCount + 1;
			}

			map.put(s, newCount);
			max = Math.max(max, newCount);
		}

		Set<String> set = new TreeSet<>();
		for(Entry<String, Integer> entry : map.entrySet()) {
			if(max == entry.getValue()) {
				set.add(entry.getKey());
			}
		}

		for(String name : set) {
			System.out.println(name);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new HashMap<>();

		int max = 0;
		for(int i = 0; i < n; i++) {
			String s = sc.next();

			Integer nowCount = map.get(s);
			Integer newCount = null;
			if(nowCount == null) {
				newCount = 1;
			} else {
				newCount = nowCount + 1;
			}

			map.put(s, newCount);
			max = Math.max(max, newCount);
		}

		Set<String> set = new TreeSet<>();
		for(Entry<String, Integer> entry : map.entrySet()) {
			if(max == entry.getValue()) {
				set.add(entry.getKey());
			}
		}

		for(String name : set) {
			System.out.println(name);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new HashMap<>();

		int max = 0;
		for(int i = 0; i < n; i++) {
			String s = sc.next();

			Integer nowCount = map.get(s);
			Integer newCount = null;
			if(nowCount == null) {
				newCount = 1;
			} else {
				newCount = nowCount + 1;
			}

			map.put(s, newCount);
			max = Math.max(max, newCount);
		}

		Set<String> set = new TreeSet<>();
		for(Entry<String, Integer> entry : map.entrySet()) {
			if(max == entry.getValue()) {
				set.add(entry.getKey());
			}
		}

		for(String name : set) {
			System.out.println(name);
		}
	} 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 HashMap<>(); map new HashMap<>() int max = 0; max 0 for(int i = 0; i < n; i++) {
			String s = sc.next();

			Integer nowCount = map.get(s);
			Integer newCount = null;
			if(nowCount == null) {
				newCount = 1;
			} else {
				newCount = nowCount + 1;
			}

			map.put(s, newCount);
			max = Math.max(max, newCount);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String s = sc.next();

			Integer nowCount = map.get(s);
			Integer newCount = null;
			if(nowCount == null) {
				newCount = 1;
			} else {
				newCount = nowCount + 1;
			}

			map.put(s, newCount);
			max = Math.max(max, newCount);
		} {
			String s = sc.next();

			Integer nowCount = map.get(s);
			Integer newCount = null;
			if(nowCount == null) {
				newCount = 1;
			} else {
				newCount = nowCount + 1;
			}

			map.put(s, newCount);
			max = Math.max(max, newCount);
		} String s = sc.next(); s sc.next() sc.next sc Integer nowCount = map.get(s); nowCount map.get(s) map.get map s Integer newCount = null; newCount null if(nowCount == null) {
				newCount = 1;
			} else {
				newCount = nowCount + 1;
			} nowCount == null nowCount null {
				newCount = 1;
			} newCount = 1 newCount 1 {
				newCount = nowCount + 1;
			} newCount = nowCount + 1 newCount nowCount + 1 nowCount 1 map.put(s, newCount) map.put map s newCount max = Math.max(max, newCount) max Math.max(max, newCount) Math.max Math max newCount Set<String> set = new TreeSet<>(); set new TreeSet<>() for(Entry<String, Integer> entry : map.entrySet()) {
			if(max == entry.getValue()) {
				set.add(entry.getKey());
			}
		} Entry<String, Integer> entry map.entrySet() map.entrySet map {
			if(max == entry.getValue()) {
				set.add(entry.getKey());
			}
		} {
			if(max == entry.getValue()) {
				set.add(entry.getKey());
			}
		} if(max == entry.getValue()) {
				set.add(entry.getKey());
			} max == entry.getValue() max entry.getValue() entry.getValue entry {
				set.add(entry.getKey());
			} set.add(entry.getKey()) set.add set entry.getKey() entry.getKey entry for(String name : set) {
			System.out.println(name);
		} String name set {
			System.out.println(name);
		} {
			System.out.println(name);
		} System.out.println(name) System.out.println System.out System System.out name 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 HashMap<>();

		int max = 0;
		for(int i = 0; i < n; i++) {
			String s = sc.next();

			Integer nowCount = map.get(s);
			Integer newCount = null;
			if(nowCount == null) {
				newCount = 1;
			} else {
				newCount = nowCount + 1;
			}

			map.put(s, newCount);
			max = Math.max(max, newCount);
		}

		Set<String> set = new TreeSet<>();
		for(Entry<String, Integer> entry : map.entrySet()) {
			if(max == entry.getValue()) {
				set.add(entry.getKey());
			}
		}

		for(String name : set) {
			System.out.println(name);
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new HashMap<>();

		int max = 0;
		for(int i = 0; i < n; i++) {
			String s = sc.next();

			Integer nowCount = map.get(s);
			Integer newCount = null;
			if(nowCount == null) {
				newCount = 1;
			} else {
				newCount = nowCount + 1;
			}

			map.put(s, newCount);
			max = Math.max(max, newCount);
		}

		Set<String> set = new TreeSet<>();
		for(Entry<String, Integer> entry : map.entrySet()) {
			if(max == entry.getValue()) {
				set.add(entry.getKey());
			}
		}

		for(String name : set) {
			System.out.println(name);
		}
	}
} Main
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new HashMap<>();

		int max = 0;
		for(int i = 0; i < n; i++) {
			String s = sc.next();

			Integer nowCount = map.get(s);
			Integer newCount = null;
			if(nowCount == null) {
				newCount = 1;
			} else {
				newCount = nowCount + 1;
			}

			map.put(s, newCount);
			max = Math.max(max, newCount);
		}

		Set<String> set = new TreeSet<>();
		for(Entry<String, Integer> entry : map.entrySet()) {
			if(max == entry.getValue()) {
				set.add(entry.getKey());
			}
		}

		for(String name : set) {
			System.out.println(name);
		}
	}
}
