import java.util.*;

class Main{

    public Main(){
        int N;
        String S;
        HashMap<String, Integer> HM = new HashMap<String, Integer>();

        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        for(int i=0;i<N;i++){
            S = scanner.next();
            if(HM.containsKey(S)){
                HM.put(S, HM.get(S)+1);
            } else {
                HM.put(S, 1);
            }
        }

        int max=0;
        for(int v : HM.values()){
            if(v > max) max = v;
        }

        ArrayList<String> R = new ArrayList<String>();
        for(Map.Entry<String, Integer> entry : HM.entrySet()) {
            if(entry.getValue() == max)
                R.add(entry.getKey());
        }

		Collections.sort(R);

		for(String str : R){
			System.out.println(str);
		}

    }

    public static void main(String args[]) throws Exception{
        Main main = new Main();
    }
} import java.util.*; util.* java class Main{

    public Main(){
        int N;
        String S;
        HashMap<String, Integer> HM = new HashMap<String, Integer>();

        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        for(int i=0;i<N;i++){
            S = scanner.next();
            if(HM.containsKey(S)){
                HM.put(S, HM.get(S)+1);
            } else {
                HM.put(S, 1);
            }
        }

        int max=0;
        for(int v : HM.values()){
            if(v > max) max = v;
        }

        ArrayList<String> R = new ArrayList<String>();
        for(Map.Entry<String, Integer> entry : HM.entrySet()) {
            if(entry.getValue() == max)
                R.add(entry.getKey());
        }

		Collections.sort(R);

		for(String str : R){
			System.out.println(str);
		}

    }

    public static void main(String args[]) throws Exception{
        Main main = new Main();
    }
} Main public Main(){
        int N;
        String S;
        HashMap<String, Integer> HM = new HashMap<String, Integer>();

        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        for(int i=0;i<N;i++){
            S = scanner.next();
            if(HM.containsKey(S)){
                HM.put(S, HM.get(S)+1);
            } else {
                HM.put(S, 1);
            }
        }

        int max=0;
        for(int v : HM.values()){
            if(v > max) max = v;
        }

        ArrayList<String> R = new ArrayList<String>();
        for(Map.Entry<String, Integer> entry : HM.entrySet()) {
            if(entry.getValue() == max)
                R.add(entry.getKey());
        }

		Collections.sort(R);

		for(String str : R){
			System.out.println(str);
		}

    } Main {
        int N;
        String S;
        HashMap<String, Integer> HM = new HashMap<String, Integer>();

        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        for(int i=0;i<N;i++){
            S = scanner.next();
            if(HM.containsKey(S)){
                HM.put(S, HM.get(S)+1);
            } else {
                HM.put(S, 1);
            }
        }

        int max=0;
        for(int v : HM.values()){
            if(v > max) max = v;
        }

        ArrayList<String> R = new ArrayList<String>();
        for(Map.Entry<String, Integer> entry : HM.entrySet()) {
            if(entry.getValue() == max)
                R.add(entry.getKey());
        }

		Collections.sort(R);

		for(String str : R){
			System.out.println(str);
		}

    } int N; N String S; S HashMap<String, Integer> HM = new HashMap<String, Integer>(); HM new HashMap<String, Integer>() Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) N = scanner.nextInt() N scanner.nextInt() scanner.nextInt scanner for(int i=0;i<N;i++){
            S = scanner.next();
            if(HM.containsKey(S)){
                HM.put(S, HM.get(S)+1);
            } else {
                HM.put(S, 1);
            }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            S = scanner.next();
            if(HM.containsKey(S)){
                HM.put(S, HM.get(S)+1);
            } else {
                HM.put(S, 1);
            }
        } {
            S = scanner.next();
            if(HM.containsKey(S)){
                HM.put(S, HM.get(S)+1);
            } else {
                HM.put(S, 1);
            }
        } S = scanner.next() S scanner.next() scanner.next scanner if(HM.containsKey(S)){
                HM.put(S, HM.get(S)+1);
            } else {
                HM.put(S, 1);
            } HM.containsKey(S) HM.containsKey HM S {
                HM.put(S, HM.get(S)+1);
            } HM.put(S, HM.get(S)+1) HM.put HM S HM.get(S)+1 HM.get(S) HM.get HM S 1 {
                HM.put(S, 1);
            } HM.put(S, 1) HM.put HM S 1 int max=0; max 0 for(int v : HM.values()){
            if(v > max) max = v;
        } int v HM.values() HM.values HM {
            if(v > max) max = v;
        } {
            if(v > max) max = v;
        } if(v > max) max = v; v > max v max max = v max v ArrayList<String> R = new ArrayList<String>(); R new ArrayList<String>() for(Map.Entry<String, Integer> entry : HM.entrySet()) {
            if(entry.getValue() == max)
                R.add(entry.getKey());
        } Map.Entry<String, Integer> entry HM.entrySet() HM.entrySet HM {
            if(entry.getValue() == max)
                R.add(entry.getKey());
        } {
            if(entry.getValue() == max)
                R.add(entry.getKey());
        } if(entry.getValue() == max)
                R.add(entry.getKey()); entry.getValue() == max entry.getValue() entry.getValue entry max R.add(entry.getKey()) R.add R entry.getKey() entry.getKey entry Collections.sort(R) Collections.sort Collections R for(String str : R){
			System.out.println(str);
		} String str R {
			System.out.println(str);
		} {
			System.out.println(str);
		} System.out.println(str) System.out.println System.out System System.out str public static void main(String args[]) throws Exception{
        Main main = new Main();
    } main {
        Main main = new Main();
    } Main main = new Main(); main new Main() String args[] args
import java.util.*;

class Main{

    public Main(){
        int N;
        String S;
        HashMap<String, Integer> HM = new HashMap<String, Integer>();

        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        for(int i=0;i<N;i++){
            S = scanner.next();
            if(HM.containsKey(S)){
                HM.put(S, HM.get(S)+1);
            } else {
                HM.put(S, 1);
            }
        }

        int max=0;
        for(int v : HM.values()){
            if(v > max) max = v;
        }

        ArrayList<String> R = new ArrayList<String>();
        for(Map.Entry<String, Integer> entry : HM.entrySet()) {
            if(entry.getValue() == max)
                R.add(entry.getKey());
        }

		Collections.sort(R);

		for(String str : R){
			System.out.println(str);
		}

    }

    public static void main(String args[]) throws Exception{
        Main main = new Main();
    }
}
