import java.util.*;
class Main{
	public static void main(String ags[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] s = new String[n];
		int[] count = new int[n];
		Map<String, Integer> map = new HashMap<>();
		for (int i = 0; i < n; i++){
			s[i] = sc.next();
			if (map.containsKey(s[i])){
				int value = map.get(s[i]);
				value++;
				map.put(s[i],value);
			} else {
				map.put(s[i], 1);
			}
		}
		int maxvalue = Collections.max(map.values()); 
		List<String> list = new ArrayList<>();
		for (Map.Entry<String, Integer> m : map.entrySet()){
			if (m.getValue() == maxvalue){
				list.add(m.getKey());
				//~ map.remove(s[i]);
			}
		}
		Collections.sort(list);
		for (int i = 0; i < list.size(); i++)
			System.out.println(list.get(i));
	}
} import java.util.*; util.* java class Main{
	public static void main(String ags[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] s = new String[n];
		int[] count = new int[n];
		Map<String, Integer> map = new HashMap<>();
		for (int i = 0; i < n; i++){
			s[i] = sc.next();
			if (map.containsKey(s[i])){
				int value = map.get(s[i]);
				value++;
				map.put(s[i],value);
			} else {
				map.put(s[i], 1);
			}
		}
		int maxvalue = Collections.max(map.values()); 
		List<String> list = new ArrayList<>();
		for (Map.Entry<String, Integer> m : map.entrySet()){
			if (m.getValue() == maxvalue){
				list.add(m.getKey());
				//~ map.remove(s[i]);
			}
		}
		Collections.sort(list);
		for (int i = 0; i < list.size(); i++)
			System.out.println(list.get(i));
	}
} Main public static void main(String ags[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] s = new String[n];
		int[] count = new int[n];
		Map<String, Integer> map = new HashMap<>();
		for (int i = 0; i < n; i++){
			s[i] = sc.next();
			if (map.containsKey(s[i])){
				int value = map.get(s[i]);
				value++;
				map.put(s[i],value);
			} else {
				map.put(s[i], 1);
			}
		}
		int maxvalue = Collections.max(map.values()); 
		List<String> list = new ArrayList<>();
		for (Map.Entry<String, Integer> m : map.entrySet()){
			if (m.getValue() == maxvalue){
				list.add(m.getKey());
				//~ map.remove(s[i]);
			}
		}
		Collections.sort(list);
		for (int i = 0; i < list.size(); i++)
			System.out.println(list.get(i));
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] s = new String[n];
		int[] count = new int[n];
		Map<String, Integer> map = new HashMap<>();
		for (int i = 0; i < n; i++){
			s[i] = sc.next();
			if (map.containsKey(s[i])){
				int value = map.get(s[i]);
				value++;
				map.put(s[i],value);
			} else {
				map.put(s[i], 1);
			}
		}
		int maxvalue = Collections.max(map.values()); 
		List<String> list = new ArrayList<>();
		for (Map.Entry<String, Integer> m : map.entrySet()){
			if (m.getValue() == maxvalue){
				list.add(m.getKey());
				//~ map.remove(s[i]);
			}
		}
		Collections.sort(list);
		for (int i = 0; i < list.size(); i++)
			System.out.println(list.get(i));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String[] s = new String[n]; s new String[n] n int[] count = new int[n]; count new int[n] n Map<String, Integer> map = new HashMap<>(); map new HashMap<>() for (int i = 0; i < n; i++){
			s[i] = sc.next();
			if (map.containsKey(s[i])){
				int value = map.get(s[i]);
				value++;
				map.put(s[i],value);
			} else {
				map.put(s[i], 1);
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			s[i] = sc.next();
			if (map.containsKey(s[i])){
				int value = map.get(s[i]);
				value++;
				map.put(s[i],value);
			} else {
				map.put(s[i], 1);
			}
		} {
			s[i] = sc.next();
			if (map.containsKey(s[i])){
				int value = map.get(s[i]);
				value++;
				map.put(s[i],value);
			} else {
				map.put(s[i], 1);
			}
		} s[i] = sc.next() s[i] s i sc.next() sc.next sc if (map.containsKey(s[i])){
				int value = map.get(s[i]);
				value++;
				map.put(s[i],value);
			} else {
				map.put(s[i], 1);
			} map.containsKey(s[i]) map.containsKey map s[i] s i {
				int value = map.get(s[i]);
				value++;
				map.put(s[i],value);
			} int value = map.get(s[i]); value map.get(s[i]) map.get map s[i] s i value++ value map.put(s[i],value) map.put map s[i] s i value {
				map.put(s[i], 1);
			} map.put(s[i], 1) map.put map s[i] s i 1 int maxvalue = Collections.max(map.values()); maxvalue Collections.max(map.values()) Collections.max Collections map.values() map.values map List<String> list = new ArrayList<>(); list new ArrayList<>() for (Map.Entry<String, Integer> m : map.entrySet()){
			if (m.getValue() == maxvalue){
				list.add(m.getKey());
				//~ map.remove(s[i]);
			}
		} Map.Entry<String, Integer> m map.entrySet() map.entrySet map {
			if (m.getValue() == maxvalue){
				list.add(m.getKey());
				//~ map.remove(s[i]);
			}
		} {
			if (m.getValue() == maxvalue){
				list.add(m.getKey());
				//~ map.remove(s[i]);
			}
		} if (m.getValue() == maxvalue){
				list.add(m.getKey());
				//~ map.remove(s[i]);
			} m.getValue() == maxvalue m.getValue() m.getValue m maxvalue {
				list.add(m.getKey());
				//~ map.remove(s[i]);
			} list.add(m.getKey()) list.add list m.getKey() m.getKey m Collections.sort(list) Collections.sort Collections list for (int i = 0; i < list.size(); i++)
			System.out.println(list.get(i)); int i = 0; int i = 0; i 0 i < list.size() i list.size() list.size list i++ i++ i System.out.println(list.get(i)); System.out.println(list.get(i)) System.out.println System.out System System.out list.get(i) list.get list i String ags[] ags
import java.util.*;
class Main{
	public static void main(String ags[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] s = new String[n];
		int[] count = new int[n];
		Map<String, Integer> map = new HashMap<>();
		for (int i = 0; i < n; i++){
			s[i] = sc.next();
			if (map.containsKey(s[i])){
				int value = map.get(s[i]);
				value++;
				map.put(s[i],value);
			} else {
				map.put(s[i], 1);
			}
		}
		int maxvalue = Collections.max(map.values()); 
		List<String> list = new ArrayList<>();
		for (Map.Entry<String, Integer> m : map.entrySet()){
			if (m.getValue() == maxvalue){
				list.add(m.getKey());
				//~ map.remove(s[i]);
			}
		}
		Collections.sort(list);
		for (int i = 0; i < list.size(); i++)
			System.out.println(list.get(i));
	}
}
