import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		HashMap<String, Integer> map = new HashMap<String, Integer>();
		int n = sc.nextInt();
		for( int i=0; i<n; i++) {
		    String str = sc.next();
		    Integer count = map.get(str);
		    if (count == null) {
		        map.put(str,1);
		    } else {
                map.remove(str);
		        map.put(str,count+1);
		    }
		}
		List list = new ArrayList();
		int max_count = 0;
		for (String key : map.keySet()) {
		    int c = map.get(key);
		    if (max_count <= c) max_count = c;
		}
		for (String key : map.keySet()) {
		    int c = map.get(key);
		    if (max_count == c) list.add(key);
		}
		Collections.sort(list);
		for (int i=0; i<list.size(); i++) {
		    System.out.println(list.get(i));
		}
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		HashMap<String, Integer> map = new HashMap<String, Integer>();
		int n = sc.nextInt();
		for( int i=0; i<n; i++) {
		    String str = sc.next();
		    Integer count = map.get(str);
		    if (count == null) {
		        map.put(str,1);
		    } else {
                map.remove(str);
		        map.put(str,count+1);
		    }
		}
		List list = new ArrayList();
		int max_count = 0;
		for (String key : map.keySet()) {
		    int c = map.get(key);
		    if (max_count <= c) max_count = c;
		}
		for (String key : map.keySet()) {
		    int c = map.get(key);
		    if (max_count == c) list.add(key);
		}
		Collections.sort(list);
		for (int i=0; i<list.size(); i++) {
		    System.out.println(list.get(i));
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		HashMap<String, Integer> map = new HashMap<String, Integer>();
		int n = sc.nextInt();
		for( int i=0; i<n; i++) {
		    String str = sc.next();
		    Integer count = map.get(str);
		    if (count == null) {
		        map.put(str,1);
		    } else {
                map.remove(str);
		        map.put(str,count+1);
		    }
		}
		List list = new ArrayList();
		int max_count = 0;
		for (String key : map.keySet()) {
		    int c = map.get(key);
		    if (max_count <= c) max_count = c;
		}
		for (String key : map.keySet()) {
		    int c = map.get(key);
		    if (max_count == c) list.add(key);
		}
		Collections.sort(list);
		for (int i=0; i<list.size(); i++) {
		    System.out.println(list.get(i));
		}
	} main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		HashMap<String, Integer> map = new HashMap<String, Integer>();
		int n = sc.nextInt();
		for( int i=0; i<n; i++) {
		    String str = sc.next();
		    Integer count = map.get(str);
		    if (count == null) {
		        map.put(str,1);
		    } else {
                map.remove(str);
		        map.put(str,count+1);
		    }
		}
		List list = new ArrayList();
		int max_count = 0;
		for (String key : map.keySet()) {
		    int c = map.get(key);
		    if (max_count <= c) max_count = c;
		}
		for (String key : map.keySet()) {
		    int c = map.get(key);
		    if (max_count == c) list.add(key);
		}
		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) HashMap<String, Integer> map = new HashMap<String, Integer>(); map new HashMap<String, Integer>() int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for( int i=0; i<n; i++) {
		    String str = sc.next();
		    Integer count = map.get(str);
		    if (count == null) {
		        map.put(str,1);
		    } else {
                map.remove(str);
		        map.put(str,count+1);
		    }
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
		    String str = sc.next();
		    Integer count = map.get(str);
		    if (count == null) {
		        map.put(str,1);
		    } else {
                map.remove(str);
		        map.put(str,count+1);
		    }
		} {
		    String str = sc.next();
		    Integer count = map.get(str);
		    if (count == null) {
		        map.put(str,1);
		    } else {
                map.remove(str);
		        map.put(str,count+1);
		    }
		} String str = sc.next(); str sc.next() sc.next sc Integer count = map.get(str); count map.get(str) map.get map str if (count == null) {
		        map.put(str,1);
		    } else {
                map.remove(str);
		        map.put(str,count+1);
		    } count == null count null {
		        map.put(str,1);
		    } map.put(str,1) map.put map str 1 {
                map.remove(str);
		        map.put(str,count+1);
		    } map.remove(str) map.remove map str map.put(str,count+1) map.put map str count+1 count 1 List list = new ArrayList(); list new ArrayList() int max_count = 0; max_count 0 for (String key : map.keySet()) {
		    int c = map.get(key);
		    if (max_count <= c) max_count = c;
		} String key map.keySet() map.keySet map {
		    int c = map.get(key);
		    if (max_count <= c) max_count = c;
		} {
		    int c = map.get(key);
		    if (max_count <= c) max_count = c;
		} int c = map.get(key); c map.get(key) map.get map key if (max_count <= c) max_count = c; max_count <= c max_count c max_count = c max_count c for (String key : map.keySet()) {
		    int c = map.get(key);
		    if (max_count == c) list.add(key);
		} String key map.keySet() map.keySet map {
		    int c = map.get(key);
		    if (max_count == c) list.add(key);
		} {
		    int c = map.get(key);
		    if (max_count == c) list.add(key);
		} int c = map.get(key); c map.get(key) map.get map key if (max_count == c) list.add(key); max_count == c max_count c list.add(key) list.add list key 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(list.get(i)) System.out.println System.out System System.out list.get(i) list.get list i String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		HashMap<String, Integer> map = new HashMap<String, Integer>();
		int n = sc.nextInt();
		for( int i=0; i<n; i++) {
		    String str = sc.next();
		    Integer count = map.get(str);
		    if (count == null) {
		        map.put(str,1);
		    } else {
                map.remove(str);
		        map.put(str,count+1);
		    }
		}
		List list = new ArrayList();
		int max_count = 0;
		for (String key : map.keySet()) {
		    int c = map.get(key);
		    if (max_count <= c) max_count = c;
		}
		for (String key : map.keySet()) {
		    int c = map.get(key);
		    if (max_count == c) list.add(key);
		}
		Collections.sort(list);
		for (int i=0; i<list.size(); i++) {
		    System.out.println(list.get(i));
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		HashMap<String, Integer> map = new HashMap<String, Integer>();
		int n = sc.nextInt();
		for( int i=0; i<n; i++) {
		    String str = sc.next();
		    Integer count = map.get(str);
		    if (count == null) {
		        map.put(str,1);
		    } else {
                map.remove(str);
		        map.put(str,count+1);
		    }
		}
		List list = new ArrayList();
		int max_count = 0;
		for (String key : map.keySet()) {
		    int c = map.get(key);
		    if (max_count <= c) max_count = c;
		}
		for (String key : map.keySet()) {
		    int c = map.get(key);
		    if (max_count == c) list.add(key);
		}
		Collections.sort(list);
		for (int i=0; i<list.size(); i++) {
		    System.out.println(list.get(i));
		}
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		HashMap<String, Integer> map = new HashMap<String, Integer>();
		int n = sc.nextInt();
		for( int i=0; i<n; i++) {
		    String str = sc.next();
		    Integer count = map.get(str);
		    if (count == null) {
		        map.put(str,1);
		    } else {
                map.remove(str);
		        map.put(str,count+1);
		    }
		}
		List list = new ArrayList();
		int max_count = 0;
		for (String key : map.keySet()) {
		    int c = map.get(key);
		    if (max_count <= c) max_count = c;
		}
		for (String key : map.keySet()) {
		    int c = map.get(key);
		    if (max_count == c) list.add(key);
		}
		Collections.sort(list);
		for (int i=0; i<list.size(); i++) {
		    System.out.println(list.get(i));
		}
	}
}
