import java.io.*;
import java.util.*;

public class Main {

	final static long MOD = 1000000007;
	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int N = Integer.parseInt(W);

		HashMap<String,Integer> map = new HashMap<>();

		for (int i = 0; i < N; i++) {
			W = in.readLine();
			if(map.containsKey(W)){
				map.put(W, map.get(W)+1);
			}else{
				map.put(W, 1);
			}
		}

		int most = 0;


		for(Iterator<String> itor = map.keySet().iterator();itor.hasNext();){
			String key = itor.next();
			most = Math.max(most,map.get(key));
		}
		ArrayList<String> list = new ArrayList<>();
		for(Iterator<String> itor = map.keySet().iterator();itor.hasNext();){
			String key = itor.next();
			if(most==map.get(key)){
				list.add(key);
			}

		}
		Collections.sort(list);
		for(String ans:list)
			System.out.println(ans);

	}

} import java.io.*; io.* java import java.util.*; util.* java public class Main {

	final static long MOD = 1000000007;
	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int N = Integer.parseInt(W);

		HashMap<String,Integer> map = new HashMap<>();

		for (int i = 0; i < N; i++) {
			W = in.readLine();
			if(map.containsKey(W)){
				map.put(W, map.get(W)+1);
			}else{
				map.put(W, 1);
			}
		}

		int most = 0;


		for(Iterator<String> itor = map.keySet().iterator();itor.hasNext();){
			String key = itor.next();
			most = Math.max(most,map.get(key));
		}
		ArrayList<String> list = new ArrayList<>();
		for(Iterator<String> itor = map.keySet().iterator();itor.hasNext();){
			String key = itor.next();
			if(most==map.get(key)){
				list.add(key);
			}

		}
		Collections.sort(list);
		for(String ans:list)
			System.out.println(ans);

	}

} Main final static long MOD = 1000000007; MOD 1000000007 public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int N = Integer.parseInt(W);

		HashMap<String,Integer> map = new HashMap<>();

		for (int i = 0; i < N; i++) {
			W = in.readLine();
			if(map.containsKey(W)){
				map.put(W, map.get(W)+1);
			}else{
				map.put(W, 1);
			}
		}

		int most = 0;


		for(Iterator<String> itor = map.keySet().iterator();itor.hasNext();){
			String key = itor.next();
			most = Math.max(most,map.get(key));
		}
		ArrayList<String> list = new ArrayList<>();
		for(Iterator<String> itor = map.keySet().iterator();itor.hasNext();){
			String key = itor.next();
			if(most==map.get(key)){
				list.add(key);
			}

		}
		Collections.sort(list);
		for(String ans:list)
			System.out.println(ans);

	} main {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int N = Integer.parseInt(W);

		HashMap<String,Integer> map = new HashMap<>();

		for (int i = 0; i < N; i++) {
			W = in.readLine();
			if(map.containsKey(W)){
				map.put(W, map.get(W)+1);
			}else{
				map.put(W, 1);
			}
		}

		int most = 0;


		for(Iterator<String> itor = map.keySet().iterator();itor.hasNext();){
			String key = itor.next();
			most = Math.max(most,map.get(key));
		}
		ArrayList<String> list = new ArrayList<>();
		for(Iterator<String> itor = map.keySet().iterator();itor.hasNext();){
			String key = itor.next();
			if(most==map.get(key)){
				list.add(key);
			}

		}
		Collections.sort(list);
		for(String ans:list)
			System.out.println(ans);

	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String W = in.readLine(); W in.readLine() in.readLine in int N = Integer.parseInt(W); N Integer.parseInt(W) Integer.parseInt Integer W HashMap<String,Integer> map = new HashMap<>(); map new HashMap<>() for (int i = 0; i < N; i++) {
			W = in.readLine();
			if(map.containsKey(W)){
				map.put(W, map.get(W)+1);
			}else{
				map.put(W, 1);
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			W = in.readLine();
			if(map.containsKey(W)){
				map.put(W, map.get(W)+1);
			}else{
				map.put(W, 1);
			}
		} {
			W = in.readLine();
			if(map.containsKey(W)){
				map.put(W, map.get(W)+1);
			}else{
				map.put(W, 1);
			}
		} W = in.readLine() W in.readLine() in.readLine in if(map.containsKey(W)){
				map.put(W, map.get(W)+1);
			}else{
				map.put(W, 1);
			} map.containsKey(W) map.containsKey map W {
				map.put(W, map.get(W)+1);
			} map.put(W, map.get(W)+1) map.put map W map.get(W)+1 map.get(W) map.get map W 1 {
				map.put(W, 1);
			} map.put(W, 1) map.put map W 1 int most = 0; most 0 for(Iterator<String> itor = map.keySet().iterator();itor.hasNext();){
			String key = itor.next();
			most = Math.max(most,map.get(key));
		} Iterator<String> itor = map.keySet().iterator(); Iterator<String> itor = map.keySet().iterator(); itor map.keySet().iterator() map.keySet().iterator map.keySet() map.keySet map itor.hasNext() itor.hasNext itor {
			String key = itor.next();
			most = Math.max(most,map.get(key));
		} {
			String key = itor.next();
			most = Math.max(most,map.get(key));
		} String key = itor.next(); key itor.next() itor.next itor most = Math.max(most,map.get(key)) most Math.max(most,map.get(key)) Math.max Math most map.get(key) map.get map key ArrayList<String> list = new ArrayList<>(); list new ArrayList<>() for(Iterator<String> itor = map.keySet().iterator();itor.hasNext();){
			String key = itor.next();
			if(most==map.get(key)){
				list.add(key);
			}

		} Iterator<String> itor = map.keySet().iterator(); Iterator<String> itor = map.keySet().iterator(); itor map.keySet().iterator() map.keySet().iterator map.keySet() map.keySet map itor.hasNext() itor.hasNext itor {
			String key = itor.next();
			if(most==map.get(key)){
				list.add(key);
			}

		} {
			String key = itor.next();
			if(most==map.get(key)){
				list.add(key);
			}

		} String key = itor.next(); key itor.next() itor.next itor if(most==map.get(key)){
				list.add(key);
			} most==map.get(key) most map.get(key) map.get map key {
				list.add(key);
			} list.add(key) list.add list key Collections.sort(list) Collections.sort Collections list for(String ans:list)
			System.out.println(ans); String ans list System.out.println(ans); System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	final static long MOD = 1000000007;
	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int N = Integer.parseInt(W);

		HashMap<String,Integer> map = new HashMap<>();

		for (int i = 0; i < N; i++) {
			W = in.readLine();
			if(map.containsKey(W)){
				map.put(W, map.get(W)+1);
			}else{
				map.put(W, 1);
			}
		}

		int most = 0;


		for(Iterator<String> itor = map.keySet().iterator();itor.hasNext();){
			String key = itor.next();
			most = Math.max(most,map.get(key));
		}
		ArrayList<String> list = new ArrayList<>();
		for(Iterator<String> itor = map.keySet().iterator();itor.hasNext();){
			String key = itor.next();
			if(most==map.get(key)){
				list.add(key);
			}

		}
		Collections.sort(list);
		for(String ans:list)
			System.out.println(ans);

	}

} public class Main {

	final static long MOD = 1000000007;
	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int N = Integer.parseInt(W);

		HashMap<String,Integer> map = new HashMap<>();

		for (int i = 0; i < N; i++) {
			W = in.readLine();
			if(map.containsKey(W)){
				map.put(W, map.get(W)+1);
			}else{
				map.put(W, 1);
			}
		}

		int most = 0;


		for(Iterator<String> itor = map.keySet().iterator();itor.hasNext();){
			String key = itor.next();
			most = Math.max(most,map.get(key));
		}
		ArrayList<String> list = new ArrayList<>();
		for(Iterator<String> itor = map.keySet().iterator();itor.hasNext();){
			String key = itor.next();
			if(most==map.get(key)){
				list.add(key);
			}

		}
		Collections.sort(list);
		for(String ans:list)
			System.out.println(ans);

	}

} Main
import java.io.*;
import java.util.*;

public class Main {

	final static long MOD = 1000000007;
	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int N = Integer.parseInt(W);

		HashMap<String,Integer> map = new HashMap<>();

		for (int i = 0; i < N; i++) {
			W = in.readLine();
			if(map.containsKey(W)){
				map.put(W, map.get(W)+1);
			}else{
				map.put(W, 1);
			}
		}

		int most = 0;


		for(Iterator<String> itor = map.keySet().iterator();itor.hasNext();){
			String key = itor.next();
			most = Math.max(most,map.get(key));
		}
		ArrayList<String> list = new ArrayList<>();
		for(Iterator<String> itor = map.keySet().iterator();itor.hasNext();){
			String key = itor.next();
			if(most==map.get(key)){
				list.add(key);
			}

		}
		Collections.sort(list);
		for(String ans:list)
			System.out.println(ans);

	}

}
