
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> m = new HashMap<>();
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if (m.containsKey(s)) {
				m.put(s, m.get(s) + 1);
			} else {
				m.put(s, 1);
			}
		}
		int max = 0;
		for (Integer i : m.values()) {
			max = Math.max(max, i);
		}
		
		List<String> list = new ArrayList<>();
		for (Map.Entry<String, Integer> e : m.entrySet()) {
			if (e.getValue() == max) {
				list.add(e.getKey());
			}
		}
		
		Collections.sort(list);
		for (String string : list) {
			System.out.println(string);
		}
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays 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 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> m = new HashMap<>();
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if (m.containsKey(s)) {
				m.put(s, m.get(s) + 1);
			} else {
				m.put(s, 1);
			}
		}
		int max = 0;
		for (Integer i : m.values()) {
			max = Math.max(max, i);
		}
		
		List<String> list = new ArrayList<>();
		for (Map.Entry<String, Integer> e : m.entrySet()) {
			if (e.getValue() == max) {
				list.add(e.getKey());
			}
		}
		
		Collections.sort(list);
		for (String string : list) {
			System.out.println(string);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> m = new HashMap<>();
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if (m.containsKey(s)) {
				m.put(s, m.get(s) + 1);
			} else {
				m.put(s, 1);
			}
		}
		int max = 0;
		for (Integer i : m.values()) {
			max = Math.max(max, i);
		}
		
		List<String> list = new ArrayList<>();
		for (Map.Entry<String, Integer> e : m.entrySet()) {
			if (e.getValue() == max) {
				list.add(e.getKey());
			}
		}
		
		Collections.sort(list);
		for (String string : list) {
			System.out.println(string);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> m = new HashMap<>();
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if (m.containsKey(s)) {
				m.put(s, m.get(s) + 1);
			} else {
				m.put(s, 1);
			}
		}
		int max = 0;
		for (Integer i : m.values()) {
			max = Math.max(max, i);
		}
		
		List<String> list = new ArrayList<>();
		for (Map.Entry<String, Integer> e : m.entrySet()) {
			if (e.getValue() == max) {
				list.add(e.getKey());
			}
		}
		
		Collections.sort(list);
		for (String string : list) {
			System.out.println(string);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Map<String, Integer> m = new HashMap<>(); m new HashMap<>() for (int i = 0; i < n; i++) {
			String s = sc.next();
			if (m.containsKey(s)) {
				m.put(s, m.get(s) + 1);
			} else {
				m.put(s, 1);
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String s = sc.next();
			if (m.containsKey(s)) {
				m.put(s, m.get(s) + 1);
			} else {
				m.put(s, 1);
			}
		} {
			String s = sc.next();
			if (m.containsKey(s)) {
				m.put(s, m.get(s) + 1);
			} else {
				m.put(s, 1);
			}
		} String s = sc.next(); s sc.next() sc.next sc if (m.containsKey(s)) {
				m.put(s, m.get(s) + 1);
			} else {
				m.put(s, 1);
			} m.containsKey(s) m.containsKey m s {
				m.put(s, m.get(s) + 1);
			} m.put(s, m.get(s) + 1) m.put m s m.get(s) + 1 m.get(s) m.get m s 1 {
				m.put(s, 1);
			} m.put(s, 1) m.put m s 1 int max = 0; max 0 for (Integer i : m.values()) {
			max = Math.max(max, i);
		} Integer i m.values() m.values m {
			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 (Map.Entry<String, Integer> e : m.entrySet()) {
			if (e.getValue() == max) {
				list.add(e.getKey());
			}
		} Map.Entry<String, Integer> e m.entrySet() m.entrySet m {
			if (e.getValue() == max) {
				list.add(e.getKey());
			}
		} {
			if (e.getValue() == max) {
				list.add(e.getKey());
			}
		} if (e.getValue() == max) {
				list.add(e.getKey());
			} e.getValue() == max e.getValue() e.getValue e max {
				list.add(e.getKey());
			} list.add(e.getKey()) list.add list e.getKey() e.getKey e Collections.sort(list) Collections.sort Collections list for (String string : list) {
			System.out.println(string);
		} String string list {
			System.out.println(string);
		} {
			System.out.println(string);
		} System.out.println(string) System.out.println System.out System System.out string 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> m = new HashMap<>();
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if (m.containsKey(s)) {
				m.put(s, m.get(s) + 1);
			} else {
				m.put(s, 1);
			}
		}
		int max = 0;
		for (Integer i : m.values()) {
			max = Math.max(max, i);
		}
		
		List<String> list = new ArrayList<>();
		for (Map.Entry<String, Integer> e : m.entrySet()) {
			if (e.getValue() == max) {
				list.add(e.getKey());
			}
		}
		
		Collections.sort(list);
		for (String string : list) {
			System.out.println(string);
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> m = new HashMap<>();
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if (m.containsKey(s)) {
				m.put(s, m.get(s) + 1);
			} else {
				m.put(s, 1);
			}
		}
		int max = 0;
		for (Integer i : m.values()) {
			max = Math.max(max, i);
		}
		
		List<String> list = new ArrayList<>();
		for (Map.Entry<String, Integer> e : m.entrySet()) {
			if (e.getValue() == max) {
				list.add(e.getKey());
			}
		}
		
		Collections.sort(list);
		for (String string : list) {
			System.out.println(string);
		}
	}
} Main

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> m = new HashMap<>();
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if (m.containsKey(s)) {
				m.put(s, m.get(s) + 1);
			} else {
				m.put(s, 1);
			}
		}
		int max = 0;
		for (Integer i : m.values()) {
			max = Math.max(max, i);
		}
		
		List<String> list = new ArrayList<>();
		for (Map.Entry<String, Integer> e : m.entrySet()) {
			if (e.getValue() == max) {
				list.add(e.getKey());
			}
		}
		
		Collections.sort(list);
		for (String string : list) {
			System.out.println(string);
		}
	}
}
